How to make horizontal layout of pandoc markdown tables? - html

Code
pandoc \
data.tex \
-f markdown \
-t html \
\
| grep -E '(^<|^$|^ *$)' \
\
| grep -v '^<p' \
\
| perl -pe 's#(?<!\\)%.*</#</#' \
\
| pandoc \
-f html \
-o vertical_output.pdf \
--latex-engine=xelatex
which gives tables on vertical layout as output, see the picture below.
Example case where horizontal table is needed
The content of the file data.tex is the following data.
Data.tex:
--------------------------------------------------------------------------------------------------------------------------------------------
Name Description Location Examples Start Peak Duration Appearance
--------------- --------------- -------------- ------------------- ---------------- -------------- --------------- -------------------
Prandial short-acting belly, Lispro (Humalog), 5-10 min before 30-60 minutes 2-4 hours Transparent
analogs abdomen Aspart (Novorapid), meal
= chemically Glulisine (Apidra)
sythesized;
Regular/short human insulin addomen Humulin R 30 min before 60 minutes 6-8 hours, Transparent
not analog meal hypoglycemia
not flexible risk
-------------------------------------------------------------------------------------------------------------------------------------------
Table: Diabetic drugs parndial and basal. Location, start, peak, duration and appearance.
giving by running the above code to the data
Comments
I would like to have a horizontal layout such that the table would be adjusted to it. I do not know to which stage I should affect to have it.
I think it should be possible in the last pandoc -process.
Too much space around sparse tables
One document has many types of tables.
The current accepted answer works well if tables are rather full, but badly with sparse tables.
Using the parameter of the accepted answer -V geometry:"paperwidth=22in, paperheight=210mm, margin=2cm", we get:
where the second table is extended too much; I would like to have it narrower; but not sure if this is possible dynamically in Pandoc.
How can you have a horizontal layout of pandocing?

Whenever you use Pandoc to produce PDF output, you can control the page size of the file with an addition to the command line. For example, generate a page with a width of 22 inches and a height of 210 Millimeters, while keeping each margin at 2 Centimeters, use this Pandoc parameter:
-V geometry:"paperwidth=22in, paperheight=210mm, margin=2cm"
I hope this example makes clear to you how you can influence the output paper size in different other ways.
However, I do not know if it answers your question. Your question is not very clear to me, I must admit.
My answer however may help other people when searching for "horizontal layout pandoc markdown".
Full commands to try
First, 12 inches width:
pandoc \
data.tex \
-f markdown \
-t html \
\
| grep -E '(^<|^$|^ *$)' \
\
| grep -v '^<p' \
\
| perl -pe 's#(?<!\\)%.*</#</#' \
\
| pandoc \
-f html \
-o vertical_output1.pdf \
--latex-engine=xelatex \
-V geometry:"paperwidth=12in, paperheight=80mm, margin=0.5cm"
Second, 14 inches width:
pandoc \
data.tex \
-f markdown \
-t html \
\
| grep -E '(^<|^$|^ *$)' \
\
| grep -v '^<p' \
\
| perl -pe 's#(?<!\\)%.*</#</#' \
\
| pandoc \
-f html \
-o vertical_output1.pdf \
--latex-engine=xelatex \
-V geometry:"paperwidth=14in, paperheight=80mm, margin=0.5cm"
Outputs (as PNG screenshots from the PDFs to make them visible here):

Related

Search for artifacts 30d or older in JFrog Artifactory

I would like to get list of artifacts which are created 30 days ago and before.
I have a script which it was providing with in time period bound, but where I need to change time in milliseconds every time. Its bit tough every time so I need to get list of artifacts which are created 30 days back with out modifying my script every time.
This is what i am using now
RESULTS=`curl -s -X GET -u <username>:<password> \
"https://<domain>.artifactoryonline.com/<domain>/api/search/creation?from=$START_TIME&to=$END_TIME&repos=$REPO" \
| grep uri \
| awk '{print $3}' \
| sed s'/.$//' \
| sed s'/.$//' \
| sed -r 's/^.{1}//'`
Your best option here is probably to use JFrog's AQL and query for artifacts with
"created" older than X days, for example, you can use an AQL query like:
items.find({"created" : {"$before" : "30d"}})
You can read more about AQL in general and about "Relative Time Operators" specifically, here
So, an example curl with a limit of 10 artifacts would look like:
curl -X POST -u <user>:<password> -H "content-type: text/plain" -d 'items.find({"created":{"$before":"30d"}}).sort({"$desc" : ["created"]}).limit(10)' https://<your Artifactory server>:<port>/artifactory/api/search/aql

Suppress Specific IP Warnings in Modelsim

A Vivado IP is generating an inordinate amount of Modelsim warnings which are making it difficult to assess the simulation for warnings I actually care about.
I see from the Modelsim command documentation that in order to suppress a warning I need to include the parameter -suppress and then the warning numbers. My current implementation is as follows...
vsim -voptargs=+acc \
-L work \
-L xil_defaultlib \
-L secureip \
-L simprims_ver \
-L unifast_ver \
-L unimacro_ver \
-L unisims_ver \
-L xpm \
-L fifo_generator_v13_1_1 \
-L blk_mem_gen_v8_3_3 \
work.blr_tb xil_defaultlib.glbl -l sv_sim.log -suppress 3015,3017,3722
This code snippet works but I am afraid that this will suppress warnings that are created by problems with my own rtl. Is there a way of suppressing specific warnings of an IP?
For reference the warnings are all from the Vivado MIG IP and look something like this...
# ** Warning: (vsim-3017) ../../ip/xc7k160t2ffg676-2/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/phy/mig_7series_v4_0_ddr_mc_phy_wrapper.v(1260): [TFMPC] - Too few port connections. Expected 9, found 8.
# Time: 0 fs Iteration: 0 Instance: /blr_tb/blr_sbk_top_i/ddr3_balor_i/u_mig_ddr3_64bit_32G/u_mig_ddr3_64bit_32G_mig/u_memc_ui_top_std/mem_intfc0/ddr_phy_top0/u_ddr_mc_phy_wrapper/gen_dqs_iobuf_HP/gen_dqs_iobuf[0]/gen_dqs_diff/u_iobuf_dqs File: C:/Xilinx/Vivado/2016.2/data/verilog/src/unisims/IOBUFDS_DIFF_OUT_DCIEN.v
The MIG is compiled with the following command...
vlog -work xil_defaultlib -incr \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/mig_ddr3_64bit_32G.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/mig_ddr3_64bit_32G_mig_sim.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/clocking/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/controller/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ecc/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ip_top/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/phy/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ui/*.v"

svnnotify html color diff

I'm using svnnotify to send notification email upon commits. I have the following script on my repo's hooks/post-commit:
#!/bin/sh
REPOS="$1"
REV="$2"
for address in $(/bin/cat /var/svn/teachbyapp/hooks/addressee.list)
do
/usr/local/bin/svnnotify \
-r $REV \
-C \
-d \
--diff-encoding utf8 \
-H HTML::ColorDiff \
-p $REPOS \
-t "$address" \
--from svn#factory.e-levelcom.com
done
It works but all I get is balck and white diff (no colors at all).
Added lines are underlined whereas removed lines have strike-through format. Nothing else, no color at all.
How can I get actually colored diff? Something like this
Ok I found it.
Thanks to this work
Also needed to append --css-inline option to svnnotify command in my script

TopoJson makefile ignoring external properties file

I am trying to make a topojson file with csv data embedded using a makefile. I am using Mike Bostock's us-atlas as a guide.
topo/us-counties-10m-ungrouped.json: shp/us/counties.shp
mkdir -p $(dir $#)
topojson \
-o us_counties.json \
--no-pre-quantization \
--post-quantization=1e6 \
--external-properties=output.csv \
--id-property=FIPS \
--properties="County=County" \
--properties="PerChildrenPos=+PerChildrenPos" \
--simplify=7e-7 \
-- $<
It creates the topojson I need but completely ignores the output.csv file.
Here is a glimpse at what it returns.
{"type":"Polygon","id":"53051","properties":{"code":"53051"},"arcs":[[-22,79,80,-75,81]]}
Here's what I need it to return.
{"type":"Polygon","id":"53051","properties":{"code":"53051", "County":"Los Angeles", "PerChildrenPos": 10},"arcs":[[-22,79,80,-75,81]]}
Any ideas why it might be ignoring the csv file, I've tested moving it around to see if perhaps it was unaccessible or something?
Thanks in advance.
According to the documentation here: https://github.com/mbostock/topojson/wiki/Command-Line-Reference#external-properties
(If your CSV file uses a different column name for the feature identifier, you can specify multiple id properties, such as --id-property=+FIPS,+id.)
It seems that you need to change your --id-property=FIPS \ to something that corresponds to your CSV column names.
Also for --properties="County=County" \
I think it should be --properties County=+County \
Same for --properties="PerChildrenPos=+PerChildrenPos" \
Should be --properties PerChildrenPos=+PerChildrenPos \
For --external-properties=output.csv \
it should be --external-properties output.csv \
Basically the parameters do not need to be prefixed by an = sign.

How to ignore directories in OpenGrok index?

I am trying to setup OpenGrok to search through a few GB of code, mostly Java and Python projects. I use opengrok-0.12.1/bin/OpenGrok index $SRC_ROOT to build the index. I can see it indexing Java's "target" and Python's ".tox" directories which I don't need.
I searched online and found the same question in many forums, and the answer being to use -i. I have tried to use this option with both the OpenGrok wrapper script as well as opengrok.jar, but all I get is the help message (because the command line options were apparently wrong).
Could you give me an example command to build indices that ignore certain directories?
The solution is to use the -i flag. The best way to do this is to create a .conf file. For example, I have the following file defined as opengrok.conf:
OPENGROK_APP_SERVER=Tomcat
OPENGROK_TOMCAT_BASE=/usr/local/Cellar/tomcat/8.0.21/libexec
OPENGROK_SCAN_DEPTH=4
OPENGROK_VERBOSE=yes
OPENGROK_PROGRESS=yes
IGNORE_PATTERNS="-i f:foo.txt -i *.bar -i d:target -i d:.tox"
And run the indexing using:
OPENGROK_CONFIGURATION=opengrok.conf ./OpenGrok index $SRC_ROOT
It ignores indexing the file foo.txt, all files that match the pattern *.bar, and all files in directories named target or .tox.
Edit credits: mrenaud, pcas
Note that https://github.com/oracle/opengrok/pull/1841 renamed IGNORE_PATTERNS to OPENGROK_IGNORE_PATTERNS (in Oct 2017).
https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok
java -jar opengrok-1.3.16/lib/opengrok.jar --help
-i, --ignore pattern
Ignore matching files (prefixed with 'f:' or no prefix) or directories
(prefixed with 'd:'). Pattern supports wildcards (example: -i '*.so'
-i d:'test*'). Option may be repeated.
with the new opengrok-tools, it looks like
opengrok-indexer \
--java_opts=-Djava.util.logging.config.file=$(OPENGROK_BASE)/etc/logging.properties \
--jar $(OPENGROK_DIST)/lib/opengrok.jar -- \
--ctags /usr/local/bin/ctags \
--source $(PWD) \
--dataRoot $(OPENGROK_BASE)/data \
--progress \
--history \
--assignTags \
--writeConfig $(OPENGROK_BASE)/etc/configuration.xml \
--analyzer .sc:ScalaAnalyzer \
--ignore 'd:zold' \
--ignore 'd:opengrok' \
--ignore 'd:tmp' \
--ignore 'd:.venv' \
--ignore 'd:.ipynb_checkpoints' \
--ignore 'd:.metals' \
# END