Code Monkey home page Code Monkey logo

Comments (3)

zapov avatar zapov commented on August 24, 2024

Please also provide JSON which I can feed via https://github.com/ngs-doo/TemplaterExamples/releases/tag/v4.3.0

I suspect it's something due to new MS Office list styles, but it would be much easier to test it if you also provided the data for it.

from templaterexamples.

zapov avatar zapov commented on August 24, 2024

I've looked over this problem and...

I've recreated JSON example so I can feed it to TemplaterJson:

{
  "Organizations":[
    {"Period":{"StartDate":{"Year":2020}},"User":{"FullName":"user 1"},"Sports":[
      {"Name":"Football", "ByType":{
        "10":{
          "Trainers":[
            {"FullName":"trainer 1","Groups":[
              {"Members":[
                {"Person":{"FullName":"member1","FormattedBirthday":"today 1","SchoolName":"school 1"}},
                {"Person":{"FullName":"member2","FormattedBirthday":"today 2","SchoolName":"school 2"}}
              ]}
            ]},
            {"FullName":"trainer 2","Groups":[
              {"Members":[
                {"Person":{"FullName":"member3","FormattedBirthday":"today 3","SchoolName":"school 3"}},
                {"Person":{"FullName":"member4","FormattedBirthday":"today 4","SchoolName":"school 4"}},
                {"Person":{"FullName":"member5","FormattedBirthday":"today 5","SchoolName":"school 5"}}
              ]}
            ]}
          ]
        },
        "20-150":{
          "Trainers":[
            {"FullName":"trtp1","Types":[
              {"Type":"type 3","FullName":"trainer 3","Groups":[
                {"Members":[
                  {"Person":{"FullName":"member7","FormattedBirthday":"today 7","SchoolName":"school 7","Rank":{"Rank":1}}},
                  {"Person":{"FullName":"member8","FormattedBirthday":"today 8","SchoolName":"school 8","Rank":{"Rank":2}}}
                ]}
              ]},
              {"Type":"type 4","FullName":"trainer 4","Groups":[
                {"Members":[
                  {"Person":{"FullName":"member9","FormattedBirthday":"today 9","SchoolName":"school 9","Rank":{"Rank":3}}},
                  {"Person":{"FullName":"member10","FormattedBirthday":"today 10","SchoolName":"school 10","Rank":{"Rank":4}}},
                  {"Person":{"FullName":"member11","FormattedBirthday":"today 11","SchoolName":"school 11","Rank":{"Rank":5}}}
                ]}
              ]}
            ]}
          ]
        },
        "210-320":{
          "Trainers":[
            {"FullName":"trainer 5","Groups":[
              {"Type":"type 5","Members":[
                {"Person":{"FullName":"member17","FormattedBirthday":"today 17","SchoolName":"school 17","Rank":{"Rank":1}}},
                {"Person":{"FullName":"member18","FormattedBirthday":"today 18","SchoolName":"school 18","Rank":{"Rank":2}}}
              ]}
            ]},
            {"FullName":"trainer 6","Groups":[
              {"Type":"type 6","Members":[
                {"Person":{"FullName":"member19","FormattedBirthday":"today 19","SchoolName":"school 19","Rank":{"Rank":3}}},
                {"Person":{"FullName":"member20","FormattedBirthday":"today 20","SchoolName":"school 20","Rank":{"Rank":4}}},
                {"Person":{"FullName":"member21","FormattedBirthday":"today 21","SchoolName":"school 21","Rank":{"Rank":5}}}
              ]}
            ]}
          ]
        }
      }}
    ]}
  ]
}

In the future please provide such JSON so I don't need to do guess and try to come up with example data which might not fit the problem at hand.

I've changed the template so that it behaves as you expect it to (maybe):
list-template-hack.docx

Currently Templater will invoke a new list number only when there is a tag on the list. So I added tags along the list number and used :hide metadata to remove those tags. It's kind of hacky solution but it does renumber the list as you expect it to (I've also changed the size of text to 1 so that template does not look really weird).

I've also looked into the expected behavior and concluded that Templater should be doing those renumbering out of the box in this cases (when there is nested table) so new version will behave like that without any changes:
list-new-version.docx

But there is something very interesting with your template which I'm not sure how to replicate. Your first and third lists have been setup in a way that they restart numbering on duplication, while the second list uses builtin style which does not restart numbering. How did you manage to setup template like that? Can you please explain the steps you used to set such style on the first list?

from templaterexamples.

zapov avatar zapov commented on August 24, 2024

This should now work as expected in v4.4

from templaterexamples.

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.