Giter Site home page Giter Site logo

Comments (8)

wooorm avatar wooorm commented on June 16, 2024 1

The main problem I see is that unified pipelines handle with one file, and if you pass that file through twice, users expect the same result. Or, if files are passed through twice in different orders (e.g., because of async), the same output could be expected as well.
unified-engine through unified-args (on the CLI) also supports watch mode, where it keeps running, and passes a changed file through on its own when its edited.

So I don’t really see an option like this solving your original issue. Or, perhaps it works for you, but it would have unexpected consequences for other users.

I also have some experience with a similar issue: one big markdown file that’s split up into multiple HTML files (for epubs, which often do that to improve rendering speed).
Like you note: remark-slug / rehype-slug don’t completely get you all the way to what’s needed. So perhaps just better to write a custom utility/plugin that handles slugs/links exactly how you’d want?

from remark-slug.

about-code avatar about-code commented on June 16, 2024 1

Okay, I see. In case of a watch mode we were likely to see sequentially increasing numbers by adding to the state of the previous run and results would vary depending on how often a file was changed. Well a bit of a pity but convincing. Time for going on with Sinatra 🎼 and doing it my way.

Had been a pleasure to contribute. Maybe next time.

from remark-slug.

about-code avatar about-code commented on June 16, 2024

A similar candidate for such a feature would be remark-reference-links (Permalink) which starts counting reference ids in a similar fashion on a per tree/per file basis.

from remark-slug.

wooorm avatar wooorm commented on June 16, 2024

What is the reason you don't first concatenate the markdown?

from remark-slug.

about-code avatar about-code commented on June 16, 2024

What is the reason you don't first concatenate the markdown?

Fair and reasonable question.

  1. In my particular case upfront concatenation would wipe semantic differences in the set of input files. For glossarify-md the file set is subdivided into glossary files and document files (much like it used to be in GitBook). Headings in glossary files are considered terms. From a conceptual perspective concatenating the set of input files into a single input file beforehand would make the resulting file a document and a glossary file at the same time.

glossarify-md would be able to handle such glossary-document-duality. But it would make every heading phrase in that file subject to "term-ination" and auto-linking which might not be what its user wants and thus should not be enforced upon users whose goal is to linkify glossary terms, only.

  1. Moreover, the actual concatenation is a bit out of scope. I just want to take care that the tool's intended audience may whish to carry out additional postprocessing on the tool's outputs, e.g. when publishing MD books in single-file formats such as PDF or single-HTML docs. What can be considered within the tool's scope, though, is to prepare output files in a way which maintains link stability when they are concatenated. I could achieve this with remark-slug (and remark-reference-links) being able to create identifiers unique across the file set.

For the sake of transparency, I do not want to hide, that after having tested my patch locally it doesn't get me the whole way, yet. There are still some rough edges to be tackled with pandoc as the concatenator and postprocessor. But apart from that "fileset uniqueness" of heading IDs remain a step into that direction. So if we focus on the question whether such a property and option were a nice addition, particularly in case of using the plug-in with unified-engine, then I'd be willing to complete the drafted PR with tests and further provide a similar one to remark-reference-links, too.

from remark-slug.

github-actions avatar github-actions commented on June 16, 2024

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

from remark-slug.

github-actions avatar github-actions commented on June 16, 2024

Hi team! Could you describe why this has been marked as wontfix?

Thanks,
— bb

from remark-slug.

wooorm avatar wooorm commented on June 16, 2024

Would love to have you as a contributor, in the future! All the best!

from remark-slug.

Related Issues (12)

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.