Giter Club home page Giter Club logo

Comments (7)

senny avatar senny commented on July 20, 2024

I agree that getting used to MailMerge fields takes some time. When I started writing this library I didn't want to bet everything on them, so I tried to structure the code in a way, which should make it possible to add different kinds of fields.

Having simple text markers like {{expression}} or <<expression>> is a possibility but brings other inconveniences. Word mechanisms like spell-checking mess with the xml structure making it very hard to properly identify the markers. From my tests, it's hard to correctly parse out expressions in flowing text.

Also note that word provides a function to update all MailMerge field labels. This should make it less painful to spot bad edits like the ones you described above.

from sablon.

senny avatar senny commented on July 20, 2024

@TheBerg any thoughts?

from sablon.

TheBerg avatar TheBerg commented on July 20, 2024

@senny We decided to postpone this feature in our app because of some of the weirdness of how MailMerge labels work in MS Word. When we get back we plan on trying to add text markers to this project, we just didn't have the time to do that. In the meantime we are using liquid & wkhtmltopdf to get the same results, just makes it harder for our end users to be able to make changes.

from sablon.

senny avatar senny commented on July 20, 2024

Thank you for the heads up, I'm going to close this for now. Feel free to ping me again if you have questions.

from sablon.

7imon7ays avatar 7imon7ays commented on July 20, 2024

I'm thinking of monkeypatching Sablon to specify my own text markers. My project is ok treating edge cases like spell-check as unspecified behavior.

Does that sound do-able? I'm guessing I'll need to change the KEY_PATTERN in mail_merge.rb and edit the field handlers.

Let me know if you think this is crazy. Or if it sounds useful I can post a snippet if / when I get working code, in case more folks want to experiment with this.

from sablon.

stadelmanma avatar stadelmanma commented on July 20, 2024

Hi @7imon7ays I'm not sure I understand what you are trying to accomplish, changing the KEY_PATTERN may be sufficient if you are still looking for mail merge fields. If you are looking for a different XML node then more logic will need changed.

from sablon.

7imon7ays avatar 7imon7ays commented on July 20, 2024

Yes I was hoping to use something other than mail merge fields because Google Docs doesn't support those. But if it requires too much of a hack I'll try another solution first. Thank you.

from sablon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.