Closed alexander-haller closed 2 months ago
In GitLab by @mhxion on Mar 8, 2024, 17:46
requested review from @alexander-haller
In GitLab by @mhxion on Mar 9, 2024, 18:05
download-attachment
, when no explicit file path is passed with --export
, will create a directory hierarchy <date>/<time?>/experiment_<id>/
and export <attachment_name>
to experiment_<id>
directory.In GitLab by @mhxion on Mar 11, 2024, 16:40
added 6 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 11, 2024, 16:47
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 11, 2024, 17:37
added 33 commits
In GitLab by @mhxion on Mar 11, 2024, 17:39
These commits are force push of the same commits. Some commits weren't properly signed due to mess up before.
approved this merge request
In GitLab by @mhxion on Mar 12, 2024, 17:06
Thanks for approving. I still need to polish some things up (to-dos above) and squash open bugs before it's finally ready.
In GitLab by @mhxion on Mar 14, 2024, 03:02
added 13 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 14, 2024, 18:45
added 5 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 14, 2024, 18:51
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 14, 2024, 18:55
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 14, 2024, 18:58
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 15, 2024, 20:53
added 4 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 15, 2024, 20:58
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 15, 2024, 21:10
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 16, 2024, 24:30
added 2 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 16, 2024, 18:25
added 1 commit
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 16, 2024, 21:08
added 2 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 16, 2024, 21:29
added 2 commits
In GitLab by @mhxion on Mar 19, 2024, 01:30
added 4 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 19, 2024, 02:05
added 2 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 19, 2024, 02:32
added 2 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 19, 2024, 02:38
added 1 commit
In GitLab by @mhxion on Mar 19, 2024, 02:45
We will do a rush merge for sake of FDM Workshop. Development on this branch will continue later.
In GitLab by @mhxion on Mar 19, 2024, 02:45
marked this merge request as ready
In GitLab by @mhxion on Mar 19, 2024, 02:46
approved this merge request
In GitLab by @mhxion on Jun 9, 2024, 15:33
We have made a lot of changes. We will delete this branch, and continue with a new branch.
In GitLab by @mhxion on Mar 7, 2024, 03:07
Merges add-experiments-plugin -> dev
Experiment plugin
append
The
append
command appends text content to existing experiments.append
accepts the following arguments.--id
: Experiment ID or experiment unique eLab ID.--text/-t
: Text string to append to an experiment.--path/-P
: Path to file (UTF-8 only) whose content to append to an experiment.--markdown-to-html/-M
: If this flag is passed thenexperiments
plugin attempt to convert any given--text
or--path
to HTML, that is if the given content is in markdown. If given content isn't in markdown then the text content is just wrapped with<p>
tag.We elaborate the details and a few corner cases in brief details. We use the experiment 16 to demonstrate our examples.
1. Normal use-case
Passing any text content to
--text
is appended to the experiment without any change to the content.--path
, its content will be appended to the experiment.--path
isn't UTF-8 encoded plugin will show an error and quit (exit code 1).--path
isn't a file (but a directory) plugin will show an error and quit.--path
and--text
are passed, the expected outcome can be ambiguous, so experiments plugin will shown an error and quit.--text
is an empty string""
or the--path
file is empty), plugin will show nothing has been appended message.2. Multi-line text
Passing multi-line text on the terminal via
--text
is possible depending on the terminal.3. Markdown to HTML
experiments plugin support converting markdown content to HTML. eLabFTW's editor supports rendering HTML text either in HTML editor mode or in markdown mode.
The output of multi-line markdown content via
--text
with-M
flag is slightly different than that of without the-M
flag which was shown above. Multi-line here is handled better which has been already shown in HeiChat.When eLabFTW editor is already in markdown mode, the case has been described also in HeiChat.
-M
flag enables the following markdown syntax features supported by Mistune:url
,task_lists
,task_lists
,abbr
,superscript
,subscript
,math
.Downsides of markdown conversion
One (one of many perhaps!) downside with the
-M
flag is when a file is a passed with--path
and the file's contents aren't markdown. This, of course, isn't the intended the use-case, and mainly a mistake from the user's end. Consider the followingChemikalienverzeichnis_Beispiel.csv
file:If this CSV file was appended with
-M
(elapi experiments append -P ./Chemikalienverzeichnis_Beispiel.csv
) then above CSV row will be parsed as:The output is simple wrapped in
<p>
tag. If the above CSV row however had un-escaped markdown syntax,-M
will try to parse the text in markdown. I.e., IfChemikalienverzeichnis_Beispiel.csv
file contained:It will be parsed as:
In other words,
--markdown-to-html
is safest to use with only markdown (.md
) and HTML files/content.Also fixes #16.