Skip to content

Commit b865aeb

Browse files
committed
update README
1 parent 2d2e44e commit b865aeb

File tree

1 file changed

+85
-19
lines changed

1 file changed

+85
-19
lines changed

README.md

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
_**Work in progress** (see also testing branch)_
55

6-
This is a simple workflow for scholarly journals, for managing the preparation of multiple publication formats. It is based on the awesome [pandoc](http://pandoc.org) and, instead of messing around with XML, it relies on the pairing of markdown (for full-text) and YAML (for metadata).
6+
This is a simple multiple-format layout workflow for scholarly journals. It is based on the awesome [pandoc](https://pandoc.org) and, instead of messing around with XML, it relies on the pairing of markdown (for full-text) and YAML (for metadata).
77

88
The workflow is based on two conversions:
99

10-
1. manuscripts from DOCX/ODT to markdown
11-
2. manuscripts in markdown + YAML to galleys files (publication formats: HTML, PDF, XML, see [output](#output)) in one take
10+
1. manuscripts from DOCX/ODT/TEX to markdown+YAML
11+
2. manuscripts in markdown+YAML to galleys files (publication formats: HTML, PDF, XML, see [output](#output)) in one take
1212

13-
This is meant to happen on a shared folder, so that a single computer could be prepared for the proper conversions, while editors could work on their own machines.
13+
The whole workflow is meant to happen on a shared folder, so that a single computer could be prepared for the proper conversions, while layout editors could work on their own machines.
1414

15-
Further considerations and a more in-depth description of the workflow are [available in this post](http://pierog.it/en/2018/03/markdown-workflow/).
15+
Further considerations and a more in-depth description of the workflow are [available in this post](http://pierog.it/en/2018/03/markdown-workflow/) (currently outdated).
1616

1717

1818
## Disclaimer
@@ -26,10 +26,10 @@ _This is also my first approach to bash scripting._
2626

2727
## Dependencies
2828

29-
- [pandoc](http://pandoc.org/), version >2.0
30-
- [TeX Live](https://www.tug.org/texlive/), tested with version 2017
31-
- a Unix shell, for running scripts
32-
- (optional) [ImageMagick](http://imagemagick.org/) is used for images optimization
29+
- [pandoc](https://pandoc.org/), version >3.0
30+
- [TeX Live](https://www.tug.org/texlive/), currently working with TeX Live 2020 (and transitioning to TeX Live 2023)
31+
- a Bash shell, for running scripts
32+
- (optional) [ImageMagick](https://imagemagick.org/) is used for images optimization (currently using ImageMagick 6.9)
3333

3434
Editors will only need a text editor in order to edit the markdown versions of the papers.
3535

@@ -53,22 +53,36 @@ The `./z-lib/` directory contains the template to generate the publication forma
5353

5454
## Workflow
5555

56-
1. Manuscripts ready for layout (in DOCX or ODT file format) will be placed by editors in a directory named `./0-original/`.
57-
2. The first conversion of manuscripts into markdown is carried from shell with `./fulltext-markdown.sh`. Converted manuscripts will be placed in the `./1-layout/` directory; an empty YAML for article-level metadata is prepended to each file.
56+
1. Copyedited manuscripts that are ready for layout preparation (in DOCX, ODT or TEX file format) will be placed by editors in the directory named `./0-original/`.
57+
2. The first conversion of manuscripts into markdown is carried from shell with [`./fulltext-markdown.sh`](#fulltext-markdown). Converted manuscripts will be placed in the `./1-layout/` directory; an empty YAML for article-level metadata is prepended to each file.
5858
3. Editors will then work in the `./1-layout/` directory, inserting metadata and other settings for each article, using YAML syntax. Editors will also fix the markdown syntax of each full-text
59-
4. When needed, the second conversion of manuscripts from markdown into publication formats is possible from shell, with `./markdown-galleys.sh`. Generated files will be available in the `./2-publication/` directory.
59+
4. When needed, the second conversion of manuscripts from markdown into publication formats is possible from shell, with [`./markdown-galleys.sh`](#markdown-galleys-options). Generated files will be available in the `./2-publication/` directory.
6060

6161
The last two steps shall be repeated until happy with the results.
6262

63-
### markdown-galleys options
63+
64+
### fulltext-markdown
65+
66+
This script converts ODT, DOCX, and TEX file to markdown format.
67+
It looks for files in the directory `./0-original/` and it writes new MD files to `./1-layout/`.
68+
69+
It requires no argument.
70+
It will archive original manuscripts (see [`./archive/`](#backup-and-archive)).
71+
72+
For suggested naming convention, see the documentation.
73+
_(ToDo: write documentation)_
74+
75+
76+
### markdown-galleys
6477

6578
Currently the script for the conversion from markdown to publication files supports some options:
6679

67-
- `-h` or `--html` for the conversion to html format
68-
- `-p` or `--pdf` for the conversion to pdf and TeX formats
69-
- `-x` or `--xml` for the conversion to xml formats
70-
- `-w` or `--word` for the conversion to docx format -- experimental
71-
- `-b` or `--backup` will backup the current markdown files (find them in the archive), without any actual conversion
80+
- `-h`, `--help`: display this message and exit
81+
- `-H`, `--html`: convert only to HTML format
82+
- `-p`, `--pdf`: convert only to PDF and TeX formats
83+
- `-x`, `--xml`: convert only to JATS XML formats
84+
- `-w`, `--word`: convert only to DOCX format -- experimental (useful for additional copyediting or antiplagiarism)
85+
- `-b`, `--backup` will backup the current markdown files (find them in [./archive/layout-versions/](#backup-and-archive)), without any actual conversion
7286

7387
Options can be combined; if no option is specified, the script will generate all formats (with the exception of the word format, that is available only when the `--word` option is given). The `--backup` option will exclude any other option.
7488

@@ -77,7 +91,7 @@ You can also specify the path of the files to be converted (one ore more); else
7791
Example:
7892

7993
```sh
80-
$ ./markdown-galleys.sh -ph ./1-layout/demo-article.md
94+
$ ./markdown-galleys.sh -pH ./1-layout/demo-article.md
8195
```
8296

8397
### Images
@@ -86,6 +100,48 @@ The first conversion will create subdirectories for media files inside `./1-layo
86100

87101
Since the `--default-image-extension` of pandoc, editors should link images within the markdown file without extension --- except if it is different from the default (JPG) --- so that the low resolution version will be used when necessary.
88102

103+
The `./img-compress.sh` script must run inside each media folder, it will prepare the files.
104+
105+
The first conversion run should always be on all the images.
106+
later you may perform actions on one or more images.
107+
Accepted formats are jpg, png, tif.
108+
109+
The following options are supported:
110+
111+
- `-h`, `--help`: display this message and exit
112+
- `-i`, `--identify`: print type, size, resolution (density) and colorspace
113+
- `-l`, `--log`: save --identify or --density to imagelog
114+
- `-p`, `--preserve`: don't convert PNG to JPG
115+
- `-D`, `--density`: set only the given density to images, don't convert (use it with --dpi)
116+
- `-d`, `--dpi`: set a different density parameter for images (default: 300)
117+
- `-L`, `--lowres`: don't convert image, just recreate the low-res version
118+
- `-w`, `--widthlow`: set a custom width for low-res version, useful with --lowres and to alter width and height (default: 800 with max height: 500px)
119+
120+
121+
### Serial-editor
122+
123+
This script performs some serial edits to the YAML part of markdown files.
124+
Each option should be launched separately.
125+
126+
The following options are supported:
127+
- `-h`, `--help`: display this message and exit
128+
- `-u`, `--undraft`: change "draft: true" to "false"
129+
- `-p`, `--publication`: set the given publication date (specified in YYYY-MM-DD format)
130+
- `-c`, `--countpages`: count the pages for each PDF in `./2-publication/`. The output can be copied and pasted as a TSV
131+
- `-s`, `--pagesequence`: reads a TSV with id/filename, starting page, ending page and writes those data to `page.start` and `page.end`
132+
133+
### Status check
134+
135+
This script is to quickly check if the files in the working directory
136+
have been updated. It will stamp a list of files for:
137+
138+
0-original/
139+
1-layout/
140+
2-publication/ [only the two most recent PDFs!]
141+
142+
It takes no arguments.
143+
144+
89145
### Backup and archive
90146

91147
Each conversion will generate an archive of backup copies and daily events logs, in order to secure the workflow. When works on an issue are closed, a complete archive of the working directory is available with `./archiver.sh`. The resulting zip will include also a copy of the setup files and of the scripts, along with a "self-contained" version of the markdown files, with the current config (in YAML) appended.
@@ -103,6 +159,16 @@ backup_path=/home/name/Backup/
103159

104160
The backup path must be absolute and will be combined with the `journal_shortname`; thus in this example the daily backup will happen in `~/Backup/demo/`. Please _double check_ your backup path before enabling this feature.
105161

162+
#### Archiving the working directory
163+
164+
This script is to archive the working directory after the issue is published.
165+
166+
It will also create a self-contained version of MD articles with metadata and settings. It takes no arguments.
167+
168+
It will prompt you to check for any leftovers (check `./archive/`!), and for the name of the zipped archive.
169+
170+
Please note that the ./archive/ itself wont be emptied.
171+
106172

107173
## Output
108174

0 commit comments

Comments
 (0)