There are several directives in Sphinx to create a boxed text, ex .. note:: or .. topic::, but they all include a title. Is it possible to create a boxed text without title?
You can use Generic Admonition.
.. admonition:: \ \
You can use a `Generic Admonition`_
.. hint::
| Generic Admonition still requires a title, but an escaped whitespace can be used!
|
| This can be convenient, because the box uses a style consistent with other admonitions.
|
| And might spare you from having to fiddle with CSS while Rome burns :)
.. _Generic Admonition: https://docutils.sourceforge.io/docs/ref/rst/directives.html#generic-admonition
Related
The multiple text separator in em editor is | in find, filter windows.
i don't want to use | separator? actually i want to use , in place of |. i didn't find any setting for this purpose.
is it possible to set the multiple text separator as , instead of | in em editor find, filter windows for multiple text (regular expression )separation permanently. where is such setting available in configuration?
This "alternation" operator ("OR" operator) | is not an EmEditor setting, but a part of regular expression syntax. You can't change this character | as far as I know.
I'm considering to move my documentation from Doxygen to Sphinx and looking for an alternative for Doxygen alias.
In Doxygen I have an alias that replaces complex command like a table to a more readable format like this (this just an examples and i have more complex and nested ones) :
table_row2{2}=<tr><td align= center>\1</td><td align= center>\2</td></tr>
or
limited_res{1}=The number of supported \1 depends on the specific platform. See the \ref appendixes section"
It can be used in the documentation like this:
...
table_h2{ Resource Name, Value }
table_row2{ MAC Entries , 256}
table_row2{ Ingress Flow , \limited_res { Ingress Flow } }
...
The closest thing I found in Sphinx is substitutions, but I have trouble to get it to work even for simple command substitutions one like below:
.. |H1| replace:: `*****************************************************`
My section
|H1|
H1 either does not compile or just print the '*...*'.
I'm not sure if this is a syntax problem or just can't be done. I trying to avoid remembering which of the */ +/ -/ = means what and name it by the level of the nesting. My memory is not very good this days :)
And the more important problem: substitutions does not seem to accept parameters which I found essential.
Another option I can think about is to write extensions like this, but I hope for a more simple method.
To get the asterisks to appear below "My section", you need to have at least one blank line separating "My section" from "|H1|". White space in Sphinx/docutils has meaning, and the separated content gets interpreted as two paragraphs instead of inline text.
.. |H1| replace:: `*****************************************************`
My section
|H1|
To display the backticks, escape them with the backslash character \.
.. |H1| replace:: \`*****************************************************\`
My section
|H1|
In case you want to insert raw, you may use the raw directive.
EDIT
This creates a section.
My section
==========
A blank line between two paragraphs will generate paragraphs, as noted above.
I have a sample.
text1_Namespace1: text
text2_Namespace2: text2
I want to make a new feature only from the Namespace1 text1 using the n-gram and not create other interactions in text2
Can the VW selectively generate ngrams for certain Namespace1?
As vw -h says, you can generate n-grams for a single namespace 'foo' using --ngram fN (e.g. --ngram f2 for bigrams, --ngram f3 for trigrams etc).
Note that in VW, only the first character of a namespace name is significant for the purpose of namespace interactions and generating ngrams. The general advice is to use either one-character namespace names or make sure that each namespace starts with a different character.
Works! Even here such a design:
vw -d test.data --loss_function logistic --skips b2 --ngram b2 --ngram g2 --skips g1
newlines on multiple lines does not seem to work out for me:
Something like:
intro: |
We are happy that you are interested in
and
more
and + more needs to be on a newline but it fails.
intro: |
| We are happy that you are interested in
| and
| more
or
intro: |
We are happy that you are interested in \n
and
more <2 spaces >
another one
All fail.
How to correctly have multiline in a yaml text block?
I use this in HAML view in rails app like
= t("mailer.beta_welcome.intro")
But no newlines are printed this way, do i need to output it differently with raw or something?
Your first example works fine
foo.yml
intro: |
We are happy that you are interested in
and
more
foo.rb
require 'yaml'
puts YAML.load_file('foo.yml').inspect
Output
{"intro"=>"We are happy that you are interested in\nand \nmore\n"}
Late answer for Googlers:
It looks like you were trying to output it as HTML, which means it was indeed outputting the newlines if you were to inspect the page. HTML largely ignores whitespace, however, so your newlines and spaces were being converted into just a space by the HTML renderer.
According to the simple_format docs, simple_format applies a few simple formatting rules to text output in order to render it closer to what the plaintext output would be - significantly, it converts newlines to <br/> tags.
So your problem had nothing to do with YAML, which was performing as expected. It was actually because of how HTML works, which is also as expected. simple_format fixed it because it took your string from YAML with newlines and converted it to a string with <br/> tags so that the newlines actually showed up in the HTML, which is what you wanted in the first place.
Ugh.. after digging more on different keywords I found that
= simple_format(t("mailer.beta_welcome.intro"))
does the trick although this seems stupid i see no workaround for now
You can put your string in single quotes, it helps me:
intro: 'We are happy that you are interested in
and
more'
I'm trying to implement a service catalog in Jekyll, in which each of 20 or 30 pages will contain a 7x2 table. The left column will hold labels, e.g. Overview, Available To, etc, while the right column will hold between one line and several paragraphs of text. I was hoping to characterize the right column with Liquid variables, e.g. {overview}, {availableTo}
I've noticed that the YAML seems to be very picky about line breaks, and accordingly I've had to input these paragraphs and their markup on one line which can go on for several screen-widths. This is a problem because it's annoying, and also because I'd like these front-matters to be editable by technical but non-webdev users. Is there a way to have the front matter tolerate breaks?
Alternatively, is there a way that I could populate this table with the {content} section, without having to recode the table into it each time?
Yaml syntax for multi-line strings is this one:
body: |
This is a multi-line string.
"special" metacharacters may
appear here. The extent of this string is
indicated by indentation.
Notice that the first line must be an space followed by the | character and a new line. Then you must indent the text one level more than its parent.
Consequently, you can create one item this way:
item1:
overview: |
overview text
more overview text
available_to: 2012-01-01
foo: |
foo text
more foo text
It seems to me that you also want to arrange your items in order. You can employ a yaml list for that:
catalog:
- id: item 1
overview: |
overview text
more overview text
available_to: 2012-01-01
foo: |
foo text
more foo text
...
- id: item2
overview: <similar to above>