kevingimbel / mktoc Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Markdown Table of Content generator
Home Page: https://kevingimbel.de/oss/mktoc
License: MIT License
๐ฆ Markdown Table of Content generator
Home Page: https://kevingimbel.de/oss/mktoc
License: MIT License
Actually write down how to use mktoc
.
Special characters like (
must be removed from the link.
The headline
## MongoDB (Atlas)
must be linked as
- [MongoDB (Atlas)](#mongodb-atlas)
but currently mktoc
produces a link like
- [MongoDB (Atlas)](#mongodb-(atlas))
Add an option to wrap the generated ToC in a <details>
element.
Example:
Code:
<!-- BEGIN mktoc -->
<details>
<summary>Table of Contents</summary>
- [Installation ๐ค](#installation)
- [Build from source](#build-from-source)
- [Prerequisites](#prerequisites)
- [Instructions](#instructions)
- [Binary releases](#binary-releases)
- [Docker](#docker)
- [Images](#images)
- [Usage](#usage)
- [Building](#building)
</details>
<!-- END mktoc -->
Important:
<summary>
is required, otherwise the markdown is not parsed.Find a way how binaries can be released and added to GitHub Releases.
Since we're using a "simple" Regex based parser to find headlines we also get things that are not a headline, e.g. comment blocks inside of code snippets:
# my comment
pub fn is_issue() -> bool {
true
}
Here # my comment
would be added to the Table of Contents. So far I cannot think of a way to fix this without using a markdown parser to process the markdown before getting the headlines.
The rendered output is wrong
Code:
<!-- BEGIN mktoc -->
- [Links in [Headlines](/headlines/)](#links-in-headlinesheadlines)
<!-- END mktoc -->
### Links in [Headlines](/headlines/)
Rendered like:
Desired Output:
<!-- BEGIN mktoc -->
- [Links in Headlines](#links-in-headlines)
<!-- END mktoc -->
### Links in [Headlines](/headlines/)
Link inside a Headline must be stripped out.
structopts will not receive new features and is integrated with clap, see https://github.com/texitoi/structopt#maintenance
As clap v3 is now out, and the structopt features are integrated into (almost as-is), structopt is now in maintenance mode: no new feature will be added.
almost as-is makes it seem like this shouldn't be much work.
We want to use cargo-dist to replace the current release pipeline with a new shiny one. Additionally, we want to build brew taps so installation on MacOS and Linux is smoother!
https://opensource.axo.dev/cargo-dist/
https://github.com/axodotdev/cargo-dist
The code responsible for adding the ToC is inside the make_toc
function. This means a third-party user cannot get a full Markdown file generated without specifying an actual file (make_toc
takes a file path).
https://github.com/KevinGimbel/mktoc/blob/main/src/lib.rs#L227-L237
Extract code into function
fn add_toc(original_file_content: String, new_toc: String) -> String
Write tests
Binaries are now build with GitHub Actions (https://github.com/KevinGimbel/mktoc/blob/main/.github/workflows/release.yml), so Windows binaries should be supported alongside Apple and Linux ones.
I know nothing about Windows binaries so I'm unsure which of these targets make sense to build for:
Maybe all of them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.