Table of contents in markdown for Nikola - nikola

I've been using Sphinx for my personal website for the past years and realized that I more have a blog with posts and few pages and did the conversion to Nikola in the past days. I also took the opportunity to switch to Markdown as I use it with R and Stack Overflow and everywhere else as well.
I have set in my Sphinx theme to have a local table of contents in the sidebar. There are a handful of very long (over 10k words) posts that would benefit from a local table of contents. I saw that the Nikola manual is written in reST and uses the contents directive. I would like to use that also in those posts.
I could convert these few posts back to reST and use the contents directive, but I'd like to avoid that. Can this be accomplished somehow?

Nikola uses Python-Markdown by default. It supports a TOC extension that one can enable in the conf.py. Then one can use a [TOC] marker anywhere in the document to get a local table of contents.

Updated
Using [TOC] which is a feature of an extension enabled by default. My firts answer was an misinterpretation of your question.
Firts answer
Using Nikola, may be you are interested in "archive" option. This is a default page that include all your posts (optional, this is grouped by date). Example in my blog: https://www.cosmoscalibur.com/archive.html .

Related

Azure DevOps Wiki: What is the value of YAML atop a page's markdown?

What is the value in adding YAML atop an Azure DevOps Wiki page's markdown, as supported by its markdown syntax: Syntax guidance for Markdown usage in Wiki, YAML tags?
It seems to offer nothing more than an alternative syntax with which to specify tables. Perhaps more elaborate tables but they'll only render atop the page. What am I missing?
As the introduction in the document,
Any file that contains a YAML block in a Wiki is processed by a table with one head and one row.
So, I think the value of YAML tags in the Wiki markdown is to convert the abstract YAML statements into a visual table on the Wiki page to increase readability and quick understanding.
Especially for a complex YAML block that may contain multiple items or multiple sub-items, the YAML tags should be very helpful.
[UPDATE]
I find an issue ticket (MicrosoftDocs/azure-devops-docs#9976) reported by another user on the GitHub repository "MicrosoftDocs/azure-devops-docs". This issue has reported a similar question.
And in this issue ticket, you also can see #amitkumariiit has given an explanation:
Yaml tags are used for general search engine optimisation. Our plan was to add the basic support for it first and then ingest this in the azure devops wiki search for optimise search. However we could not prioritise the search side of work.
If you need more detailed explanation, you can follow this issue ticket and add your comments to it.
I am going to propose my own answer. It just occurred to me that this is likely intended to replace markdown, not to be used with markdown. That is to say, to support documentation written purely in YAML. That could make some sense, add value for some, and explain why it's ONLY supported atop the page. You use it instead of the markdown, not with the markdown.
The documentation just doesn't make it clear why/how you might want to use this feature.

How to create external link references in AsciiDoc without repeating the URL multiple times?

In markdown I can write:
[example1][myid]
[example2][myid]
[myid]: http://example.com
so I don't have to retype the full external link multiple times.
Is there an analogous feature in AsciiDoc? Specially interested in the Asciidoctor implementation.
So far I could only find:
internal cross references with <<>>
I think I saw a replacement feature of type :myid:, but I can't find it anymore. And I didn't see how to use different texts for each link however.
Probably you mean something like this:
Userguide Chapter 28.1. Setting configuration entries
...
Attribute entries promote clarity and eliminate repetition
URLs and file names in AsciiDoc3 macros are often quite long — they break paragraph flow and readability suffers. The problem is compounded by redundancy if the same name is used repeatedly. Attribute entries can be used to make your documents easier to read and write, here are some examples:
:1: http://freshmeat.net/projects/asciidoc3/
:homepage: http://asciidoc3.org[AsciiDoc3 home page]
:new: image:./images/smallnew.png[]
:footnote1: footnote:[A meaningless latin term]
Using previously defined attributes: See the {1}[Freshmeat summary]
or the {homepage} for something new {new}. Lorem ispum {footnote1}.
...
BTW, there is a 100% Python3 port available now: https://asciidoc3.org
I think you are looking for this (and both will work just fine),
https://www.google.com[Google]
or
link: https://google.com[Google]
Reference:
Ascii Doc User Manual Link
Update #1: Use of link along with variables in asciidoc
Declare variable
:url: https://www.google.com
Use variable feature using format mentioned above
Using ' Link with label '
{url}[Google]
Using a relative link
link:{url}[Google]

How can I automatically update all of the filenames for my middlman blog posts after rewriting the titles?

I have a whole load of blog posts in middleman and have just worked on improving the titles, which are written in the frontmatter section at the top of the markdown file. However, the filenames are all still set to the old titles, and retyping them is a pain. Is there a quick way to either regenerate all the filenames from the current title, or get middleman to ignore the filename at build time and create a new filename for the generated HTML based on the current title?
I am not aware of any built-in option that does what you need.
You would have to use your favorite language to build something quick and dirty that does that for you. In pseudocode:
Iterate over all blog files and for each file:
Read the file's contents and extract the new and nice title from the front matter using a regular expression
Rename the file according to your desired naming scheme. You could include the original date (if present), make titles URL friendly etc.
Whether that would be more efficient than manually renaming all files it depends of course on the number of blog posts as well as you programming experience!

Translating Magento frontend

Is there a way to easily just translate Magento default frontend through csv file, translating everything would be too time consuming and not really needed as it would make admin panel very confusing for me.
Same question was asked in Magento forums 4 years ago, but there was no easy way to do it at that time, but apparently Mangento team was contacted and they promised to look into it. So has anything changed since then?
Look into your /app/locale/en_US folder. There you have .csv's that do the translating. Everywhere you see $this->__('Checkout') or any other string, Magento hits up this folder for specific files that dictate what to replace with "Checkout" and every other string which echo's this way.
In the CSV files, the first field is the text to look for within $this->__(''), the second is what to replace it with. You'll also find different language translation files here.
Each CSV is named after the namespace it belongs to. Hence, Mage_Catalog.csv contains the translations for all the files that use the /app/code/core/Mage/Catalog/ classes and /app/design/frontend/your_package/your_theme/catalog template files.
Here, you'll also find Mage_Adminhtml.csv, which handles most of the admin translations.

How to insert metadata in Sphinx?

I want to insert some metadata (i.e. keywords, description, author) inside my web pages created by Sphinx.
I found
:fieldname: Field content
in the documentation of Sphinx, but I have no idea how to use it.
I already figure out. There is a directive called "meta", which perfectly meets my desire.
You can find it here: http://docutils.sourceforge.net/docs/ref/rst/directives.html#meta

Resources