In org-mode, when you export HTML projects you can use templates to give all exported pages the same options, this is described here http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html. What I would like to do, is give all exported pages an HTML snippet, for analytics, which is not an option. Is this possible with org-templates?
Now, I tried to add literal HTML code to the base template level-0-template.org with
#begin_html
...
#end_html
but it didn't work out. Does anyone know how to add html code to each HTML file that is exported in the project?
My project is organized as follows:
|- org
|- index.org
|- html
|- index.html (this is exported)
|- templates
|- level-0.org (I'd like to include default html here)
|- org_publish.el (this is the publishing config file)
To expand on my comment in the question, here is the difference between #+setupfile: and #+include:.
Details about both are available in the Org-Mode manual. See Setup File and Include Files.
The setupfile is essentially a list of all org configurations that are included in the linked file. It will pass things such as #+options. It will not however include any other content that the original file might include.
On the other hand, #+include: inserts the content of the linked file wherever the line is inserted. It acts similarly to \input in LaTex. I'm not certain to what degree it will bring along any org-configuration settings from the linked file, you may need to both #+include and #+setupfile the file to ensure everything is present. However since you do want the body content of the file to be included in each, you have to use #+include to insert it.
Glad you found a solution to your problem by sourcing your snippet as a separate html file.
If you wanted to make it work by having the snippet directly included in your template file, you should use:
#+BEGIN_export html
...
#+END_export
instead of:
#+BEGIN_html
...
#+END_html
(The latter will embed the html chunk as a block in the rendered html page-not what you want; the former will export the html chunk as is in the html file so that that code will be rendered when the page is displayed-what you want).
Related
I am trying to have basic collapsing/folding functionality for sections in the HTML file that has been exported from org-mode, since the files I want to share are very large. I am using Emacs 26.2 (9.0) and Org 9.1.9 on a Mac.
This seems like a built in feature, but I haven't seen any effect from adding #+INFOJS_OPT commands to my org files before exporting to HTML. I also saw another tool mentioned on the mailing lists, but without any examples I don't know how apply it to a specific org file I have.
For example, the following file is converted to HTML which looks identical to the same file without the INFOJS_OPT lines
#+Title+: JS test
#+INFOJS_OPT: path:js/org-info.js
#+INFOJS_OPT: toc:nil ltoc:nil view:overview mouse:underline
#+INFOJS_OPT: home:https://orgmode.org buttons:nil
* Chapter 1
** Section 1
*** Part 1
- csp
** Section 2
- cs2p
I have a freshly-downloaded copy of js/org-info.js.
There is a slight difference in the HTML generated, but this seems to have no effect. I'm at a loss for how I can have folding in the resulting HTML - open to solutions even outside of org-info.js.
Seems that org-info.js is not maintained anymore. Here they provide the source code in JavaScript, for anyone willing to tweak/update it.
https://lists.gnu.org/r/emacs-orgmode/2017-07/msg00049.html
Luckily someone updated it (thanks Daniel Clemente!).
The procedure is:
Download esquemadorg.js at the following link: https://www.danielclemente.com/pagina/esquemadorg.js
Add the following lines at the top of your .org file
#+HTML_HEAD_EXTRA: <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
#+HTML_HEAD_EXTRA: <script type="text/javascript" src="esquemadorg.js"></script>
Make sure that src="esquemadorg.js" points at the file relative to where the html exported file is located.
Some text in Spanish (or Portuguese?) will appear on the exported document. You can do a full search in the esquemadorg.js file and change it to English. Mine looks like this now.
par.append(document.createTextNode("Press on a section header to collaps/expand it."));
par.append( $( document.createElement('a') ).text(" COLLAPSE ALL ").addClass("globalexpandtool").click(close_all_sections));
par.append( $( document.createElement('a') ).text(" SHOW ALL ").addClass("globalexpandtool").click(open_all_sections));
$("div#table-of-contents").after(par);
There are doxygen commands #include, #htmlinclude, #verbinclude and the rest of the family. Each of them is equivalent to inlcuding the file inline and surrounding it with a pair of start and end tags like #code, #htmlonly, #verbatim etc.
For the life of me, I cannot find the doxygen command equivalent to just pasting a markdown file into the docblock without surrounding it with any tags that modify the interpretation of the included fragment.
Is this possible? How?
Is it posible to import a BibTex library in Libre Office Writer?
I have a BibTex file that was generated with BibDesk and which I woul like to import in Libre Office.
Yes BibDesk can export to .doc (libre can import .doc) and many other formats. You can aslo modify the formats
Ref sourceforge SEC117
Export Templates
Templates allow you to export your database to a large variety of formats. It also allows you to customize to a great extent how the data is exported.
To export using templates, choose the "Export..." menu item, which can be found under the "File" menu. You can choose the template from the "File Format" popup button. You can either export the whole database, or just the references which you have selected.
BibDesk provides several default templates, for export to HTML, RSS, Rich Text (RTF, RTFD) and to windows Doc format.
You can also modify a template
Bibdesk Templates
You can find a set of default template files in the folder ~/Library/Application Support/Bibdesk/Templates. For HTML export, there are 3 template files: htmlExportTemplate.html, htmlItemExportTemplate.html and htmlExportStyleSheet.css. Generally, only the first of these template files is required
Looking at the htmlExportTemplate.html file first, this is a relatively simple html document, with a standard header, a link to the external CSS file, and a single "content" div in the body. The formatting of the individual entries into the html file is done using the htmlItemExportTemplate.html file. Opening this file, you will see that the template files comprise a series of items enclosed in < and > signs, the same as those used in HTML to enclose formatting tags, but starting with an extra $. These entities are known as Template Tags.
They are parsed by BibDesk to include the relevant parts of the BibDesk database in the html file. E.G. will be replaced by the contents of the "Title" field in the BibDesk database. A list of the different kinds of Tag is given in the Export Template Keys page. It is also possible to apply modifiers to the field Tags in order to format the contents. One example is the Tag where the full name or an abbreviated name can be chosen, and the "and"s between authors can be replaced by commas. These modifier keys are also explained at the Export Template Keys page.
I hope this helps
I'm referring to TAGS file generated by ctags or etags in order to have some code navigation in Emacs with M-..
The typical project looks like this:
Large standard library (more than 100 files, but rarely updated).
Project-specific library (updated on the daily basis).
I would like the project to be able to use two (or maybe more TAGS files), but regenerate only the portion of them, only the ones used inside the particular project. How would I approach this problem?
etags --help:
-i FILE, --include=FILE
Include a note in tag file indicating that, when searching for
a tag, one should also consult the tags file FILE after
checking the current file.
Is there a simple way to add something like the {Back to Worg's index} to every .org page in a directory which I plan to publish with org-publish-project-alist? Is this accomplished with a #+ tag, or some definition in the .css file?
I looked at how they did it on Worg, and it doesn't look like CSS.
There are a few ways you might be able to do so.
Create a generic file that only includes the details you want in each file. For example:
[[./index.org][Back to index]]
Then use #+include: <filename> at the location in your file where you want the line. (See Include Files)
Alternately you could define a macro in a setupfile (See In-Buffer Settings) that is the definition of the link (or multiple link choices)
#+macro: toIndex [[./index.org][Back to index]]
In both cases it is worth noting that the relative paths are based on the exported file. So a [[../index.org]] will always point to the index.org file in the parent directory, no matter where the setupfile is.