Giter Club home page Giter Club logo

Comments (12)

DCsunset avatar DCsunset commented on August 21, 2024

I believe you could use the incrementSection option to specify how many levels you want to increment. The reason for not detecting it automatically is that it will make it impossible to add some level 1 sections at the end (like the appendix)

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

incrementSection helps some but doesn't solve all cases. Consider for example nested includes. When writing a document which might be included the author doesn't know the current level and hence doesn't know desired increment.

How about incrementSection="auto"?

from pandoc-include.

DCsunset avatar DCsunset commented on August 21, 2024

For incrementSeciont, the author of the included document doesn't need to know how many levels to increment. It's the responsibility of the author who wants to include other documents. Maybe I misunderstood your question. If so, could you provide an example to explain why the author doesn't know the current level?

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

from pandoc-include.

DCsunset avatar DCsunset commented on August 21, 2024

Is it necessary for doc2 to know the the absolute level in doc1? incrementSection works by incrementing all the section levels. So as long as doc2 knows the how to set doc3's level relatively, it should work because doc1 can increment the levels of both doc2 and doc3 altogether

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

from pandoc-include.

DCsunset avatar DCsunset commented on August 21, 2024

Yes I think so. It's based on the nature of recursive include. You can always try it easily to verify it when you doubt it.

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

I've tested now and it works as you say. So current functionality works but I still think incrementSection="auto" would be a nice feature (saving me some thinking and make it easier to rearrange).

from pandoc-include.

DCsunset avatar DCsunset commented on August 21, 2024

Yes I think that may help. However, it's hard to define the auto behaviour as there's no end boundary for sections.

For example, if we have the following markdown:

# Sec 1

Section 1

# Sec 2

Section 2

!include file.md

What would you expect the incrementSection to be? It's reasonable to use either 0 or 1 here.

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

from pandoc-include.

DCsunset avatar DCsunset commented on August 21, 2024

I see. It makes sense now. auto is a kinda confusing name as I originally thought you were suggesting a more intelligent approach. I would vote for current as it always needs to match with the current level.

from pandoc-include.

olowo726 avatar olowo726 commented on August 21, 2024

from pandoc-include.

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.