Comments (8)
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.
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.
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.
What is the reason you don't first concatenate the markdown?
from remark-slug.
What is the reason you don't first concatenate the markdown?
Fair and reasonable question.
- 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.
- 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.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
from remark-slug.
Hi team! Could you describe why this has been marked as wontfix?
Thanks,
— bb
from remark-slug.
Would love to have you as a contributor, in the future! All the best!
from remark-slug.
Related Issues (12)
- Mismatch between GH Emoji and Slug HOT 1
- does not add anchors to headings using GitHub’s algorithm HOT 4
- When creating slugs (within gatsby-plugin-mdx), accents make the anchors fail HOT 7
- remark-slug doesn't take current URL into consideration HOT 2
- Allow slugger to be passed in HOT 2
- link in header leads to unexpected parsing HOT 1
- Types definitions HOT 5
- Emoji leads to weird slug HOT 4
- Add `-` before headings whose ID starts with number to avoid URL issue HOT 1
- Compatibility with remark-react? HOT 7
- Compatible with `remark-autolink-headings` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remark-slug.