bkuhlmann / tocer Goto Github PK
View Code? Open in Web Editor NEWA command line interface for generating Markdown table of contents.
Home Page: https://alchemists.io/projects/tocer
License: Other
A command line interface for generating Markdown table of contents.
Home Page: https://alchemists.io/projects/tocer
License: Other
When a document has ruby code blocks that contain comments, the comments should not be included in the table of contents.
The following document is an example of what should happen:
<!-- Tocer[start]: Auto-generated, don't remove. -->
# Table of Contents
- [Introduction](#introduction)
- [Code Blocks](#code-blocks)
<!-- Tocer[finish]: Auto-generated, don't remove. -->
# Introduction
Text here
## Code Blocks
```ruby
# This is a comment describing the code
class MyRubyClass
end
```
The actual behavior is to include ruby comments as table of contents entries:
<!-- Tocer[start]: Auto-generated, don't remove. -->
# Table of Contents
- [Introduction](#introduction)
- [Code Blocks](#code-blocks)
- [This is a comment describing the code](#this-is-a-comment-describing-the-code)
<!-- Tocer[finish]: Auto-generated, don't remove. -->
# Introduction
Text here
## Code Blocks
```ruby
# This is a comment describing the code
class MyRubyClass
end
```
tocer -g README.md
inside the eebs/tocer_test repo.Tocer 3.1.1
Ruby 2.3.1
OSX 10.11.6
We have a markdown file in our wiki with no #header
elements:
Design assets like logos and icons can be found on Google Drive.
https://drive.google.com/drive/u/3/folders/xyz
An automated script runs tocer to generate a TOC for all markdown files in the directory. This file currently has 12,150 blank lines preceeding the two lines of content, and 12162
commits in the git log for it.
$ tail Design-Resources.md
Design assets like logos and icons can be found on Google Drive.
https://drive.google.com/drive/u/3/folders/xyz
$ tocer --version
Tocer 12.0.1
$ tocer -b -i Design-Resources.md
Design-Resources.md
$ git diff | xclip
diff --git a/Design-Resources.md b/Design-Resources.md
index 4491ed77..d8bfcb56 100644
--- a/Design-Resources.md
+++ b/Design-Resources.md
@@ -12148,6 +12148,7 @@
+
Design assets like logos and icons can be found on Google Drive.
Tocer should not modify files if it did not make any changes.
$ uname -a
Linux ava.home 5.11.20-200.fc33.x86_64 #1 SMP Wed May 12 12:48:34 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ ruby --version
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
$ gem --version
3.2.15
$ tocer --version
Tocer 12.0.1
Hello Brooke,
I just noticed your tocer-gem on rubygems.org.
I use markdown for my gems and admittedly, I use a very simple markdown.
Other than headers and bold text, and an image here or there, I think that sums up
most of my markdown-use so far in the last ... two years or so. :-)
Anyway, to my suggestion:
But I am not entirely sure how to use tocer from an existing .md file.
If you could add a minimum example for the next tocer release, that would be
great! Feel free to close this issue at any moment in time.
Thanks!
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.