Numbering table of contents for Gitbook - tableofcontents

I want to number the table of contents for a book processed by gitbook but cannot figure out how to do this. If I use the Gitbook editor, there is a preference to see the numbering while editing, but I cannot see the numbering when creating an html version of the book.
I know it is possible to do so: the table of contents (sidebar) of https://gitbookio.gitbooks.io/documentation/content/format/chapters.html
is numbered. By comparison, the one for https://toolchain.gitbook.com/ is not.

Apparently, this is no longer set up by default and the following needs to be added do book.json, when using the default theme:
"pluginsConfig": {
"theme-default": {
"showLevel": true
}
}

Related

I cannot change FontSize when trying to modify text style in docx by using DocumentFormat dll

I looked at document.xml of my Template. There are "w:sz", "w:szCs", "w:lang", "w:b" inside for "w:p" and "w:r". I opened my doc.docx and only saved using DocumentFormat.dll. I see that appropriate text is in "w:t" element of a "w:r" of a "w:p" element and ect in the output. I see that the "w:r" has "w:rPr" and there are "w:b", "w:rFonts w:ascii w:cs, w:hAnsi" inside of it. "w:p" also has some properties. But "w:sz", "w:szCs" are not present. I tried to create RunStyleProperties and to prepend to an existing paragraph like in "how can I change the font open xml" except i did not create a run, used foreach for existing paragrapths and runs. I tried to recreate methods that are described in "https://learn.microsoft.com/en-us/office/open-xml/how-to-apply-a-style-to-a-paragraph-in-a-word-processing-document",but all my attempts were not effective. The fact is the style was not applied, the text style has some default values.

Can I select the layout to use for a page with Wyam?

I'm working on a theme for Wyam and I'm wondering if there's a way to set the layout that should be used in the markdown file for a particular page. As far as I have seen so far, it seems that each page created with markdown uses _Layout.cshtml
To be more specific. I'm creating an "about.md" page, which has a different layout then then other (default) pages.
So what I would like to do is use metadata to select the layout. For example
Layout: _About.cshtml
or
Layout: _About
Is this possible with Wyam?
In A Razor File
Pages in the Wyam recipes (I'm assuming you're using either the blog or docs recipe) are processed by Razor. The use of a _Layout.cshtml is by convention in the recipe, but alternate layouts can be specified using standard Razor syntax. You can do so by placing the following at the top of the about page .cshtml file (under your front matter):
#{
Layout = "_About.cshtml";
}
In A Markdown File
Markdown files are also processed by the Razor engine, so the technique above would work if it weren't for the Markdown processor escaping the # symbol. There's really no good way around that, and the simple answer to your question is you can't specify an alternate layout for a Markdown file.
However, one of the advantages of using a code-driven generator like Wyam is that you have a lot of control. In this case, you can replace the RenderPages pipeline with one that will do exactly what you want. Add the following to your wyam.config file:
int index = Pipelines.IndexOf(Blog.RenderPages);
Pipelines.Remove(Blog.RenderPages);
Pipelines.Insert(index, Blog.RenderPages,
(IPipeline)new Wyam.Web.Pipelines.RenderPages(
Blog.RenderPages,
new Wyam.Web.Pipelines.RenderPagesSettings
{
Pipelines = new string[] { "Pages" },
Layout = (doc, ctx) => doc.String("Layout", "/_Layout.cshtml")
}));
Then you'll be able to add a "Layout" value as front matter exactly like you wrote in your question.
This was a good idea in general, so I've also opened an issue to add this behavior to the recipe by default.

TYPO3 Mask_Export: Any way I can export my mask elements without deleting the content?

I'm currently working on a TYPO3 Project and used the mask extension for the first time. I created a lot of elements, used them on the site and filled them with content. I just read in the manual that the mask extension itself causes some performance problems which i didn't knew about..
I installed the mask_export extension to prevent those, but now my content is gone.. I tried to just tell my TYPO3 to use the new content element but my contents ist still not displayed in it.
Is there any way I can use the mask_export extension in a running project without deleting my content?
If You use ext:mask_export your defined mask elements are exported in a new extension.
While the elements are exported they were renamed acording to the new extension name.
If you now deactivate mask and enable your new extension, your existing content (tt_content-records) have the wrong CType (there is no rendering definition).
Solution:
Reenable mask, deactivate your new extension and build a test-page with all content elements, then disable mask and enable your extension and build all content elments again (additionally). Now you can do a SQL-query (SELECT CType FROM tt_content WHERE pid=123) to identify the used CTypes and do database wide replacements.
Be aware, that the extension name may be used in other places (e.g. prefix for tables or fields). This needs to be fixed too.
Conclusion:
It's a bad idea to replace mask after content is inserted, as it generates a lot of manual work in the database.

tt_news: use news title as download title in list view

My news should not contain any text, except for the title. Instead, in the list view the title should directly point to the first attached file (a PDF).
Now I thought the simplest solution for that would be to hide the title, show only the attached files and give them the title of the related news entry via TypoScript.
For the detail view this code works fine:
plugin.tt_news.newsFiles {
labelStdWrap.cObject = TEXT
labelStdWrap.cObject.dataWrap = DB:tt_news:{GPvar:tx_ttnews|tt_news}:title
labelStdWrap.cObject.wrap3 = {|}
labelStdWrap.cObject.insertData = 1
}
...but it uses the GPvar for the currently displayed news, which of course is not present in list view.
So my question is: how do I get the ID of the currently iterated news entry, if possible at all?
I am open to other solutions as well.
You will need to use custom itemMarkerArrayFunc - fastest by copying the sample into your own extension: typo3conf/ext/tt_news/res/example_itemMarkerArrayFunc.php and adding custom marker to $markerArray.
The mentioned sample even demonstrates access to files so I assume that should not be a problem to modify it for your needs.
Note: if you haven't any own ext to copy the func into it, and you don't want to create such, try to copy it somewhere under fileadmin folder, modifying files in original destination is wrong idea, cause you'll lost all changes after next tt_news' update.
Easiest solution I found is using the labelStdWrap:
plugin.tt_news.newsFiles {
labelStdWrap = TEXT
labelStdWrap.field= title
}
More options can be found here: http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.0.0/view/5/13/

Word 2010 Show Table only in footer of last page

I've a template for word. In header and footer I've got logos of my company. The data of word is generating automatically from ERP program (that works great).
I only want to show some table with data on last page. I've tried this this method But it only works for text. When I'm updating the field the table and it's content disappear.
Anyone knows how to apply this method on table? It must to be automatic.
The same method works for block level content such as paragraphs or tables. Simply follow the same steps but instead of typing "Initials" insert your table there. Make sure to use speechmarks in the conditional e.g it should look like this { IF {PAGE} = {NUMPAGES} "" "(table)" }