Markdown tabs in GitLab Markdown - gitlab

I am writing documentation that has steps for Windows, Mac, Linux.
I want to make it look like this HTML5 tabbed HTML5 example
there is support for HTML in gitlab markdown
There is a reference to a sanitation class that validates the inline HTML in gitlab marrkdown
My question is:
Recommendations to achieve the tabbed documentation. Is there a workaround for displaying CSS correctly in markdown?
how to make this work?

Simply insert the relevant HTML/CSS/JS into your Markdown document.
As Markdown's Syntax Rules state (emphasis in original):
Markdown's syntax is intended for one purpose: to be used as a format
for writing for the web.
Markdown is not a replacement for HTML, or even close to it. Its
syntax is very small, corresponding only to a very small subset of
HTML tags. The idea is not to create a syntax that makes it easier
to insert HTML tags. In my opinion, HTML tags are already easy to
insert. The idea for Markdown is to make it easy to read, write, and
edit prose. HTML is a publishing format; Markdown is a writing
format. Thus, Markdown's formatting syntax only addresses issues that
can be conveyed in plain text.
For any markup that is not covered by Markdown's syntax, you simply
use HTML itself. There's no need to preface it or delimit it to
indicate that you're switching from Markdown to HTML; you just use
the tags.
The only restrictions are that block-level HTML elements -- e.g. <div>,
<table>, <pre>, <p>, etc. -- must be separated from surrounding
content by blank lines, and the start and end tags of the block should
not be indented with tabs or spaces. Markdown is smart enough not
to add extra (unwanted) <p> tags around HTML block-level tags.
However, there is one down side to this:
Note that Markdown formatting syntax is not processed within block-level
HTML tags. E.g., you can't use Markdown-style *emphasis* inside an
HTML block.
Finally, there is the concern that you appear to looking to have this document hosted on a third party site (perhaps in a readme on Gitlab). Most third party sites who process and host Markdown documents (including Gitlab) run the output through an HTML sanitizer for security reasons (to avoid XSS attaches, etc). Therefore, you are likely to find that various required hooks in your HTML will be stripped out and it won't work. Of course, this won't be a problem on your own site where you have total control.

The solution was tried in readme.rd from the text processor used by Microsoft VsCode and commited to gitlab. In the attached picture there is the rendering. It was not as expected. Perhaps the functionality to have tabs will be available soon.

An alternative is "collapsible sections" in GitLab Flavored Markdown. Link to documentation: link

Related

Generate HTML from MathJax code in a batch script

I know how to use MathJax to convert TeX commands in a web page to mathematical formulae. The MathJax scripts would search the page for TeX commands and convert them inline to HTML statements.
Is there a way to do this as a form of pre-processing? In other words, I have some text or HTML files on my harddisk that contain raw TeX commands. I'd like to use MathJax to convert them to HTML, so that they can be viewed without having the MathJax scripts.
The reason I need this is that these pages are very long and contain many, many TeX statements. MathJax is fast, but it's not fast enough for such huge pages, so I need to preprocess them.
Thanks for any hints.
MathJax-node provides APIs for using MathJax in nodejs, thus enabling this kind of preprocess. There are examples in the repository for handling HTML fragments.
The SVG output can be used this way but the HTML-CSS output cannot because it is very client dependent.
However, the new CommomHTML output -- which has been completed in MathJax v2.6, currently in beta -- will be usable this way. It will be integrated into mathjax-node once v2.6 is out of beta.

Mathjax: how to deal with this strange behavior?

I am using the markdown editor and I have loaded Mathjax in all pages of my website.
I have realized that this line of latex works well:
$(u_1)$
However, this one does not work (basically latex does not work):
$(u_1,u_2)$
In order to make this work, I have to write something like this:
$(u\_1,u\_2)$
I have a similar problem here. This does not work:
$$M=\left(\begin{array}{cc}
a & b \\
c & d \\
\end{array}\right)$$
But this works:
$$M=\left(\begin{array}{cc}
a & b \\\\
c & d \\\\
\end{array}\right)$$
This is a common issue of mixing LaTeX-input with Markdown. From the MathJax documentation:
There cannot be HTML tags within the math delimiters (other than <br>) as TeX-formatted math does not include HTML tags.
And later:
Another source of difficulty is when MathJax is used in content management systems that have their own document processing commands that are interpreted before the HTML page is created. For example, many blogs and wikis use formats like Markdown to allow you to create the content of you pages. In Markdown, the underscore is used to indicate italics, and this usage will conflict with MathJax’s use of the underscore to indicate a subscript. Since Markdown is applied to the page first, it will convert your subscripts markers into italics (inserting tags into your mathematics, which will cause MathJax to ignore the math).
As other answers on SO (see the link at the top) point out, some markdown parsers are more aware of TeX-like syntax than others.

Defining a vim syntax file that selectively applies other syntax files in different regions

Is there a way to define a syntax file in Vim that is essentially a "meta" layer on top of other syntax files? By this I mean that the file defines syntax highlighting regions, but all it does for each region is specify a different syntax file to be applied to that region. This is useful for PHP embedded in HTML, or any other sort of file mixing languages. I am aware that there are scripts that handle PHP and HTML together, but I don't think they do it in the manner I described. I'm interested in the general solution to this problem.
That's what :syntax include is for. With it, you can mark certain regions in the buffer, and apply the subordinate syntax in there. As long as the regions are clearly delimited and do not mix, this works pretty well. This is used for example in the HTML syntax to include JavaScript inside <script> tags, and Vimscript uses that for Perl, Python, and other integration languages. You'll find these scripts at $VIMRUNTIME/syntax/.
Alternative
My SyntaxRange plugin provides a different approach, where you can highlight certain regions with another syntax, without defining a separate new syntax. This is used for more adhoc markup, e.g. to highlight a Python snippet inside an HTML blog post, or to automatically highlight inline patches inside an email body.
Composite filetypes
Finally, there are add-on syntaxes that go "on top" of a main syntax. An example is cpp.doxygen. You cannot do that with arbitrary syntaxes, though; the script has to be specially written to support that.

Render MathML directly to HTML without using script tag

I know the default way to render the MathML to HTML is placing the MathML code inside and SCRIPT tag, then use MathJax to typeset the elements containing the SCRIPT tags.
I am wondering if there is an easy way to config the MathJax to directly process the MathML code without placing the MathML inside a script tag? So when the MathJax typesetting the HTML elements containing the tags, the MathML can be rendered to the HTML without using any script tags.
This would be very useful when the MathML can be edited on the web and it wants to prevent the editors to input the dangerous scripts by confusing they are the MathML script tags.
The mml2jax preprocessor will find the MathML directly on the page (without enclosing in script tags). All the combined configuration files (e.g., MML_HTMLorMML) include it automatically, so you don't have to do anything special to use it if you are using one of those configurations. If you are doing your own configuration, then include
MathJax.Hub.Config({
extensions: ["mml2jax.js"]
});
as part of it.
(The mml2jax preprocessor will find the MathML tags and put them into the needed script tags for you, so the page will still include those script tags, but the user doesn't have to type them. Of course, you don't want the user to edit the output of MathJax directly, but rather edit the original markup, so they should never see the script tags.)

what is the best way to mark any text?

I need users to mark some section of text with custom tags, I can't use the xml based tags as the whole text will be embedded in XML documents and all the < will be converted to html escape code <. I want users to marks some section of text with tags like skip, bookmark, these tags can have attributes also like bookmark name="first".
Which is the best way of allowing users to mark text using the BB forum way like [b]abcd[/b]
or using {{bookmark name="first"}}.
Or is there any better scheme or technique available.
I don't want to change the structure of the text as down by the markdown or textile, I just want to tag some section of text, like the phpBB tags. The question is there any other style than phpBB? Like in some software I see {{bookmark name = "abcd"}} style.
The three common markups I know of for this purpose are Markdown (used, I believe, by SO), textile, and BBCode. The first two are commonly used for blog sites and CMS frameworks, and BBCode I think is usually associated with bulletin-board sites. Preview and mapping utilities are available for each.
You can have a look at the Textile markup language to see if it fits your needs. It has many implementations and nice documentation.

Resources