Command Line Search Through Folder - Multiple Options - command-line

How can I use the command line to search through a folder of html and css files identifying html files that:
Have divs with class .highlight
Have img tags
Do not have divs with class .main

For simple queries you can use grep (avaliable on *nix platforms usually, can install on Windows as well) which uses regular expressions, but that would only work in one case here. For your image tags:
grep -R <img *.html
Otherwise you would actually need a parser because what you are talking about requires parsing html tags and examining their contents. There are many libraries out there for this- but it's not something built into the command line.
Using regular expressions to parse HTML: why not?

Related

Does Mkdocs convert single quotes into apostophe?

According to this answer there is a different between apostrophe and single quotes in html.
In my markdown I wrote the following line:
Asyncio libraries you aren't using
Then on the built website the output was:
Asyncio libraries you aren’t using
Notice the difference around n't
So now when I copy the rendered html output and search for that line in vscode - it is not found due to the single quote being changed into an apostrophe.
I prefer that the rendered output is the same as my markdown to help in this instances of searching.
Is there a setting in vscode to treat them similarly or is this a problem with mkdocs rendering that can be fixed?

Cannot export org mode to collapsible HTML

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);

Include an external .md file in a docblock?

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 possible to combine Doxygen commands?

\todo \image html clone.png
The intent here is to place an image inside the todo but it appears that when you put one tag after another, the tag is ignored. Is there a way to do this? I've tried it with more than just \image, it appears to be the case with any two tags you use in succession.
There are many ways to get images into your documentation. Maybe try with html and it might not break your \todo command.
\todo <IMG SRC=clone.png>
You can also create an alias in your setup file that makes it easy and clean to include your image.
I too have found that some commands seem to end other commands. Note that not ALL commands will end your "\todo" command. Font commands such as \c like in the example for \arg does not end the command.
http://www.doxygen.nl/manual/commands.html#cmdarg

Inline Code For a GitHub README Using MediaWiki

I'm writing a README.mediawiki file for my project called plainBlog on GitHub, but I want to add some inline code on it. What is the syntax for this? Also, what is the syntax for XML code (multiple lines)?
An example of inline code is located at github/markup, where we have lines like this: gem install wikicloth
There's a few:
Start each line with a space.
Text is '''preformatted''' and
''markups'' '''''can''''' be done
or:
<pre> Text is '''preformatted''' and
''markups'' '''''cannot''''' be done</pre>
For inline <code> spans there is no special syntax:
<code>Source code</code>
From http://www.mediawiki.org/wiki/Help:Formatting