CodeSnap addon for VSCode
The extension CodeSnap will take beautiful screenshots of your code in VS Code without effort.
Open your file in vscode, select the desired lines, press CTRL-SHIFT-P, run CodeSnap
. You just need to select lines now.
The extension CodeSnap will take beautiful screenshots of your code in VS Code without effort.
Open your file in vscode, select the desired lines, press CTRL-SHIFT-P, run CodeSnap
. You just need to select lines now.
A callout (called admonition by Docusaurus) is a special syntax used to highlight a paragraph, f.i. a Pay attention to... or Tip: Did you know that... box.
On this blog powered by Docusaurus, the syntax for admonition is
:::caution[Pay attention to...]
Never give your bank card code to a stranger.
:::
and this is rendered like
Never give your bank card code to a stranger.
And now a nice tip:
By going to bed earlier, you'll get better quality sleep.
Quarto implements this a little differently, so let's have a look...
Using the Quarto includes
short code, writing a long document can easily be broken down into several smaller ones.
Imagine the following main.qmd
file:
# My thesis in Latin
{{< include chapter1.md >}}
{{< include chapter2.md >}}
Quarto will then merge the three files when you render main.qmd
.
Don't want to take the time to create a CSS class and figure out how to integrate it into Quarto to quickly highlight part of your paragraph?
Quarto supports an inline css style syntax for producing HTML documents (not working for, f.i., pdf or docx).
You can apply styles to inline text by creating spans using []
to surround the text you want to style and {}
to define the style you want to apply.
If you're writing for Docusaurus, there are a few tips to know.
This article is by no means exhaustive, but for me it's a reminder of the features that are really essential and must not be forgotten.
You are writing Markdown .md
files (and you're so right) and you just wish to check (and autofix) some issues like having multiple blank lines, mixing bullet types (-
and *
in the same document), using a #
title followed by ###
(i.e. you forget the level ##
) and many more.
There is a tool for this: Markdown lint and, a Docker image peterdavehello/markdownlint
.
Let's learn how to use it.
How many times have you modified a file in vscode (and forgotten to save the modification) in order to refresh it from your web page, run the script from your console, etc., and then thought Oh no, damn, it still doesn't work?
And it can take several minutes and back and forth before, damned, silly me, I didn't save my modification.
And even more so when you've done a Search&Replace in several files; some having been saved and others not.
Let's see how to avoid this.
Docusaurus didn't provide an easy way to retrieve the number of blog posts but there is well a trick.
There is an automatic page called archive
like https://www.avonture.be/blog/archive/.
On that page, all blog posts are displayed by year and months. With a document.querySelectorAll
console instruction it's possible to make the count as suggested on https://github.com/facebook/docusaurus/discussions/9712
My use case is: I need to write some technical, long, documentation where I need to provide some information like IP addresses of used servers, some paths to the application, configuration folders, ...
The normal way to do this is to just put information directly in the documentation and to make sure to update every occurrence in case of changes during the lifecycle of the application.
The best way is probably to use an external file where information are stored in a key-value form and, during the rendering process of Quarto, replace short codes by values.
The Quarto reveal.js documentation is the best place to find instructions for creating impeccable reveal.js presentations.
In this article, we'll take a quick look at a few tips and tricks to make your reveal.js presentations even better.