Verbatim Text in Doxia APT Table - maven

Using Doxia APT format, I would like to include verbatim text or a snippet within a table.
*------------+----------------------------+
|| col1 || col2 |
*------------+----------------------------+
| some text | VERBATIM TEXT OR SNIPPET |
*------------+----------------------------+
However, since doxia verbatim text and macros both must be non-indented, and the table requires preceding markup, I'm not sure if there is an easy way to accomplish this.
To be more specific, I am using Maven 3 to generate site documentation with apt documents. I would like to include multi-line JSON representations in a table column.
As a workaround, each line is monospaced and several of the json characters must be escaped, which is not easy to read or maintain (although the rendered page appears fine). For example:
*------------+----------------------------+
|| col1 || col2 |
*------------+----------------------------+
| some text | <<<\{>>>\ |
| | <<<\ "id":"12345",>>>\ |
| | <<<\ "name":"value">>>\ |
| | <<<\}>>> |
*------------+----------------------------+
Ideally, in order to maintain readability of the table, I would prefer to use a doxia snippet or similar macro to dynamically insert the code, but could also use verbatim text. For example, I would like to be able to do something like the following, which isn't valid:
*------------+-----------------------------+
|| col1 || col2 |
*------------+-----------------------------+
| some text | %{snippet|url=example.json} |
*------------+-----------------------------+
Is there any way to accomplish this?

Related

Shell filter text where text is length 0 after delimiter

I try to expand a text filter function to have the possibility to ignore line that do contain text after a delimiter ":" Currently I use
helm template "mychart.tgz" | yq '..|.image? | select(.)' | sort | uniq
this will list all containers inside the template.
I want to ignore container that contain text inside the tag.
like
mypod:
hold
mypod:tag
ignore
Can someone help me with a tipp?

What is the Miller command for separating emails into their own rows, while also copying down other column data?

I have a very large csv file (213,265 rows) with many columns.
In one of those columns I have some emails seperated by commas. A trimmed down version of the csv file looks like this:
I would like to use Miller to seperate out those emails into their own rows, but also copy down ALL the other columns in the spreadsheet (many of which aren't shown here in this simple example).
Following on with this example, I would like to end with something like this. But keep in mind the real spreadsheet has many other columns before and after the email column:
Is that possible to do with Miller (or another similar tool)? What would the command look like?
The verb is nest. Starting from
company,address,email
anna,123 fake,"anna#ciao.it,annac#gfail.com,a#box.net"
and running
mlr --csv nest --explode --values --across-records --nested-fs "," -f email input.csv
you will have
+---------+----------+-----------------+
| company | address | email |
+---------+----------+-----------------+
| anna | 123 fake | anna#ciao.it |
| anna | 123 fake | annac#gfail.com |
| anna | 123 fake | a#box.net |
+---------+----------+-----------------+
If you have a "bad" CSV, you could have some problems and you should try to clean it. A generic clean command could be this one:
mlr --csv -N clean-whitespace then remove-empty-columns then skip-trivial-records then cat -n sample.csv | mlr --csv nest --explode --values --across-records --nested-fs "," -f Email >output.csv
It removes empty rows, empty columns and wrong white spaces.

Rendering this pandoc table

+---------------+---------------+--------------------+
| Right | Left | Centered |
+==============:+:==============+:==================:+
| Bananas | $1.34 | built-in wrapper |
+---------------+---------------+--------------------+
I used the standard command
pandoc test.txt -o test.pdf
But I get the above unrendered text. Am I doing something wrong here?
I am new to pandoc tables. Are grid tables fundamentally different than other tables supported by pandoc markdown?
I managed to render this adapted version in stackedit.io
| Right | Left | Centered |
|-:|:-|:-:|
| Bananas | $1.34 | built-in wrapper |
And your version in pandoc/try, which did work as expected. Try specifying the input and output format, and also try a different output format to see if that works.

How to get the same output using Excel-VBA code?

I am working with an excel file, it only has one column as follows:
Type
A:\AAA\AD\RER\TES\11111\&DD&MM&AA.EXT
C:\AAA\CD\RES\TES\33333\&DD&MM&AA.EXT
C:\CCC\DF\WSD\&DD&MM&AA&SQ2.TXT
C:\DDDD\RT\FDG\334455&DD&MM&AA&SQ2.TXT
C:\DDD\YU\DFS\55555&DD&MM&AA&SQ2.TXT
C:\RRR\ER\SDF\55555&DD&MM&AA&SQ2.TXT
C:\TTT\CD\ERW\55555&DD&MM&AA&SQ2.TXT
C:\YYY\YU\WET\555555&DD&MM&AA.EXT
I would like to extract the following output:
&DD&MM&AA.EXT
&DD&MM&AA.EXT
&DD&MM&AA&.TXT
334455&DD&MM&AA&.TXT
55555&DD&MM&AA&.TXT
55555&DD&MM&AA&.TXT
55555&DD&MM&AA&.TXT
555555&DD&MM&AA.EXT
The approach that I followed to extract it was using bash since I am a beginner in the usage of excel, my command was the following:
rev colum.txt | tr -d " " | cut -d "\\" -f1 | rev | sed "s/SQ2//"
The problem with this is that I would like to achieve the same result using a macros of excel, I don't know how to program it, I would like to appreciate a suggestion of how to transform this bash code to Excel-VBA, supposing that the column that contains the data is the column A.
With data in column A, in B1 enter:
=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"\",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))+1,9999)
and copy down.

Ditaa not aligning

It should be clear to know (for a human) what I want this ditaa-input file to look like
/---------------------------\
| TEST |
+--------------+------------+
| foo() | "yuck < 3" |
+--------------+------------+
| bar() | NEVEREVER! |
+--------------+------------+
| antlioneater | (x>5) || d |
\--------------+------------/
But it doesn't. Look at the less/greater signs. Plus, that is one out-of-shape antlioneater!
What am I doing wrong? I invoked ditaa v0.9 as ditaa -E -e utf8 test.txt.
I suggest using another character that looks like it, for example ‹ and ›.
It's a bit of a trick, but since the output of ditaa is an image anyway, having a visually similar character is usually good enough.
I personally use this to embed HTML markup in my ditaa charts.
Ditaa parses > and < as arrow heads even if they are not attached to a line ( --> ), hence the weird rendering. It's unfortunate, but that's how it is!

Resources