Giter Club home page Giter Club logo

Comments (10)

senny avatar senny commented on August 21, 2024

@alepore Can you upload a ruby script and a sablon template that reproduces the error? This would go a long way to help me debug the issue.

from sablon.

alepore avatar alepore commented on August 21, 2024

@senny thanks, simple reproduction script: http://s000.tinyupload.com/index.php?file_id=38574526047958687033

from sablon.

senny avatar senny commented on August 21, 2024

@alepore thanks for the reproduction. There was an issue with your template and with some minor modifications I was able to get the desired output:

screen shot 2015-06-23 at 09 22 56

While you did see the style "ListBullet" when authoring the template.docx it was not actually part of the template. Word has a root template called Normal.dot. That's where common styles are saved. While visible in Word, the styles of Normal.dot are not part of your template by default.

The following steps allow you to manage the styles that are part of your template:
screen_shot_2015-06-23_at_09_30_24
screen_shot_2015-06-23_at_09_30_38
screen_shot_2015-06-23_at_09_30_48

Once you copied the styles over from Normal.dot and save your template the example should work as expected. As Sablon matures I'll add more template validation and introspection. It's a common pitfall and I'd like to make it more explicit.

Thanks for reporting. I'm going to close the issue but please report back if you get it working or still have questions related to your example.

from sablon.

alepore avatar alepore commented on August 21, 2024

Thanks for reply!
The gem is really easy to use, the hard part is definitely the word template :)

Something is wrong here because i see ListBullet on both template.docx, output.docx and Normal.dot
but i still don't see the style on the output (but i can manually apply it)

screen shot 2015-06-23 at 10 10 44

screen shot 2015-06-23 at 10 11 17

screen shot 2015-06-23 at 10 20 44

from sablon.

senny avatar senny commented on August 21, 2024

@alepore did you try copying over the ListBullet style from Normal.dotm and overwrite the one in template.docx. It might very well be that one is only a reference to the other. Copying over the style did the trick for me...

from sablon.

alepore avatar alepore commented on August 21, 2024

mhh i think i tried any way to add/copy the style.
the problem is with the list itself, because if a create another formatting style (like red color) and name it ListBullet it works.
Maybe it's something with my list style...

from sablon.

senny avatar senny commented on August 21, 2024

@alepore that sounds very much like the issue I described... You can't change the styles of Normal.dotm so when you modify a given style it's saved in the template itself. To use the default "ListBullet" style you should:

  1. Open your template
  2. Go to the organizer as described above
  3. Copy over "ListBullet" from "Normal.dotm" into your template
  4. Save & run Sablon

Those were the exact steps I used with your example.

from sablon.

alepore avatar alepore commented on August 21, 2024

@senny if i start with a clean setup and i open my template i don't have ListBullet on Normal.dotm but only on the template.
i can recreate the style, there's a optional checkbox to add it to Normal.dotm, then i can follow your steps but i still don't see the list ;(

from sablon.

senny avatar senny commented on August 21, 2024

@alepore that sure is strange. If I open a blank word document in my case, the Normal.dotm has all the predefined styles. Maybe you somehow managed to change your Normal.dotm... Anyway, if using the style in the template document works, it must be defined somewhere. It's basically a matter of copying the right definition into the template to get it working. Modifying the style slightly usually gets the job done.

from sablon.

alepore avatar alepore commented on August 21, 2024

Just FYI:
I used Office 2016 for mac and now it works.
There was definitely something wrong with Office 2011 for Mac.

Thanks again for support!

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.