cli-ssg
markdown-it
cli-ssg | markdown-it | |
---|---|---|
11 | 55 | |
0 | 17,295 | |
- | 1.5% | |
0.0 | 8.5 | |
over 2 years ago | about 2 months ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cli-ssg
-
Releasing and publishing through npm
Over the past couple of weeks, I've been working on cli-ssg, which is a command line tool to generate a website using .txt/.md files. A lot of changes had accumulated, and this was the perfect time to create an official release 1.0.0.
-
Adding CI through GitHub Actions
Last week, I added some tests to cli-ssg using jest, but right now the only way to run them is to run them manually. While this works, having an automated process in place to run the tests would be much better, as that would mean that any change that breaks the tests, cannot be merged.
-
Adding static analysis tooling to cli-ssg
Static analysis tools help us maintain the quality of our source code by fixing formatting issues, spotting suspicious coding constructs, or alerting us to common errors. As cli-ssg is a collaborative open source project, it becomes especially important to have these in place to enforce common formatting and linting.
-
Exploring Docusaurus and enhancing cli-ssg
Since I had created a basic static site generator (cli-ssg), I wanted to explore other bigger projects that were working on the same problem. One such popular SSG is Docusaurus which is a React based static site generator backed by Facebook.
-
Refactoring existing code and rebasing
That being said, index.js was looking a bit messy after the pull request for the --config option was merged into main (#18).
-
Working with remotes
Someone also created a similar issue on my project cli-ssg earlier this week to add support for a config JSON file and so I assigned it to them. There hasn't been a pull request as of me writing this blog, but I look forward to reviewing it! https://github.com/dhillonks/cli-ssg/issues/17
-
Addressing merge conflicts
This week I worked on adding more functionality to cli-ssg. I decided to add support for a --lang flag to specify language and add the ability to produce horizontal rule: Add support for horizontal rule in markdown Add a -l flag to generate the lang attribute
-
Contributing code to open source repositories
Once I had approval from the owner, the .md ticket was assigned to me and I started off by forking the repository and creating a branch to work on the issue (dhillonks/commandline-ssg:issue-8). The code in the repo was already organized into modules which made it easier for me to expand the parsing functionality. I ended up splitting the parsing method to add a flow for .md files. This ensured that I wasn't affecting any old functionality, leaving the parsing for .txt as is. After some coding, I was able to parse .md files and detect headings h1-h6. I used the first h1 text as the placeholder for . The tool could now also generate paragraphs properly for separated lines which were not headings. Moreover, both
**bold**
and__bold__
markdown syntax forbold
text were supported. Along with these code changes, I also modified theReadme.md
file to document this new functionality.Creating a pull request to get the work accepted into the original repo
After I had thoroughly testing my changes, making sure that the new functionality worked and also ensuring that it didn't break any old functionality, I created a pull request on the original repository.
Link to the pr to commandline-ssg - Click here!
I included a description of the changes that were made, the functionality that was added and sample usage for
.md
files. I also pinged the code owner to review the pull request once it was created. Today, I just found out that my changes were approved and the pull request was merged!Reviewing a pull request to cli-ssg
I also received a pull request to the open source tool I had created earlier.
Link to the pr to my repo - Click here
The pr was also adding functionality to parse
.md
files including the headings, bold, italics, links and strikethrough. It looked good at a first glance and the functionality mostly worked but I ended up finding a few issues after looking closely.
The biggest problem was thatparagraphs were not being generated for non-headings. This was obviously an big problem which I need to highlight.
Also, it rendered bold usingand italics using
which is not the best way to markup emphasis. So I suggested that bold should instead use
and italics should instead use
.
My last suggestion was not a bug, but since the PR was also implementing the syntax support for links, I wanted to make sure that it also supported automatic links i.e. links within angled bracesshould be rendered to an anchor tag.
I highlighted these and requested changes when I added my review to the pr. I look forward to reviewing the pr again once these changes are made. -
Open-source: collaborating with others
Unused variables
-
Working In Open Source
Issue #1 There are some defined variables that never used in the code. const yargs = require("yargs"); const path = require("path"); These two variables are never used in the code, so I suggested my partner to remove them.
markdown-it
-
Creating excerpts in Astro
Parse it into HTML using markdown-it
-
Creating an Automated Profile README using Nodejs and GitHub Actions
We can easily use markdown-it, a markdown parser for rendering a mix of JavaScript and plain text into a markdown file. To get started, kindly create a new directory with the following file structure:
-
Construindo um Painel de Blog Dinâmico com Next.js
github.com/markdown-it/markdown-it - markdown biblioteca.
-
Is deep selector still needed?
Recently, I am using markdown-it. Due to the nature of Vue and virtual DOM. You cannot style style inside v-html with scoped style. The only solution for me is global css and deep selector. I choose the latter
-
Implementing collaborative docs
You could probably use markdown-it in your web app to create a notes program where Markdown is used. That tool has lot of plugins. I used it in a small project for myself to test it and it worked like a charm and you can style it so it looks modern. Nevertheless I do not remember if there is a plugin for collaborative writing so users can edit the same file simultaneously but if it does not exist, you can probably work that out by yourself.
-
dd
markdown-it - Markdown parser done right. Fast and easy to extend.
-
Render markdown from a string with Vue components instead of HTML tags
I don't quite get what you mean. I've used [markdown-it](https://github.com/markdown-it/markdown-it) and overwrite its render rule for images, so it returns an NuxtImg instead of an native img tag.
-
So here’s a stupid question: using the chat API, what’s the best way to deal with formatting the results for web?
I've been using markdown-it and highlight.js for code snippets, and so far it's been working pretty great straight out of the box without any other parsing or format prompting
-
Why I love Markdown
It then, gets compiled down to regular HTML by a markdown processor so that the browser can understand it and display it on the screen.
-
How to convert markdown to json in react js
Maybe Markdown It? link
What are some alternatives?
commandline-ssg
marked - A markdown parser and compiler. Built for speed.
starter-workflows - Accelerating new GitHub Actions workflows
remark - markdown processor powered by plugins part of the @unifiedjs collective
PEG.js - PEG.js: Parser generator for JavaScript
js-yaml - JavaScript YAML parser and dumper. Very fast.
nearley - 📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript.
docx-to-pdf-on-AWS-Lambda - Microsoft Word doc/docx to PDF conversion on AWS Lambda using Node.js
Jison - Bison in JavaScript.
strip-json-comments - Strip comments from JSON. Lets you use comments in your JSON files!
obsidian-pandoc - Pandoc document export plugin for Obsidian (https://obsidian.md)
Highlight.js - JavaScript syntax highlighter with language auto-detection and zero dependencies.