-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redirect all basecast pages to try.perm.pub
- Loading branch information
Showing
6 changed files
with
11 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,4 @@ | ||
# Basecast | ||
|
||
Basecast is an authoring tool that: | ||
|
||
* generates [baseprint](https://perm.pub/HKSI5NPzMFmgRlb4Vboi71OTKYo) contents, | ||
* reads [Pandoc](https://pandoc.org) source formats such as LaTeX and Markdown, | ||
* can generate HTML and PDF previews, | ||
* can automatically regenerate outputs when source files are edited, and | ||
* is [open-source](https://gitlab.com/castedo/basecast). | ||
|
||
Basecast can be run in the cloud (GitHub) or from the command line. | ||
|
||
|
||
## Run in the cloud (GitHub) | ||
|
||
Start the try.perm.pub tutorial: | ||
|
||
[Author a Baseprint via GitHub](https://try.perm.pub/tutorial/basecast_via_github/){ .md-button .md-button--primary target='_blank' } | ||
|
||
|
||
## Run from the command line | ||
|
||
Instead of running basecast as a GitHub Action, | ||
you can run it from the command line. | ||
Here's a simple example of bash commands that demonstrate `basecast`: | ||
|
||
``` | ||
echo Hello World > doc.md | ||
basecast doc.md --baseprint=out | ||
``` | ||
|
||
The above example will generate a baseprint in the `out` | ||
subdirectory, which will contain a JATS XML file named `article.xml`. | ||
For more details, consult the [Usage page](usage.md). | ||
|
||
To use Basecast from the command line, it needs to be either "installed" via containers | ||
or installed locally. | ||
|
||
|
||
### Setup 1: Container | ||
|
||
Running `basecast` in an [OCI](https://opencontainers.org/){ target='_blank' } | ||
(Docker) container is the recommended way to try `basecast` | ||
as it avoids many common installation problems. | ||
|
||
[Setup via containers](https://try.perm.pub/howto/basecast_container/){ .md-button } | ||
|
||
|
||
### Setup 2: Packages | ||
|
||
Running `basecast` via a container | ||
will download and cache almost a gigabyte of container image data. | ||
Installing `basecast` directly will consume much less disk space. | ||
However, installing packages locally is more difficult and might not work. | ||
|
||
[Install packages](https://try.perm.pub/howto/install_basecast/){ .md-button } | ||
--- | ||
template: redirect.html | ||
location: https://try.perm.pub/basecast/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,4 @@ | ||
# Usage | ||
|
||
To use the command line interface, | ||
[run basecast via OCI/Docker container](https://try.perm.pub/howto/basecast_container/) | ||
(recommended) or | ||
[install software packages](https://try.perm.pub/howto/install_basecast/). | ||
|
||
``` | ||
usage: basecast [-h] [-b BASEPRINT] [-o OUTDIR] [-C DIRECTORY] [--skip-pdf] | ||
[-m MONITOR] [-d DEFAULTS] | ||
[infiles ...] | ||
positional arguments: | ||
infiles pandoc input files | ||
options: | ||
-h, --help show this help message and exit | ||
-b BASEPRINT, --baseprint BASEPRINT | ||
baseprint output directory | ||
-o OUTDIR, --outdir OUTDIR | ||
HTML/PDF output directory | ||
-C DIRECTORY, --directory DIRECTORY | ||
run from this directory | ||
--skip-pdf Do not generate PDF | ||
-m MONITOR, --monitor MONITOR | ||
paths to monitor | ||
-d DEFAULTS, --defaults DEFAULTS | ||
pandoc default option settings | ||
``` | ||
|
||
The non-option arguments for input files (`infiles ...`) are passed through to | ||
[`pandoc`](https://pandoc.org). | ||
Pandoc will concatenate multiple input files. | ||
Options for `-d` and `--defaults` for defaults files are also passed through to `pandoc`. | ||
See the [Defaults files section of the Pandoc User's | ||
Guide](https://pandoc.org/MANUAL.html#defaults-files) for more information. | ||
|
||
|
||
## Markdown | ||
|
||
Files with the `.md` suffix will be parsed as Markdown by [`pandoc`](https://pandoc.org). | ||
A simple way to try `basecast` is to write plain text into a `doc.tex` file and pass it | ||
as an input file to `basecast`. | ||
|
||
``` | ||
basecast doc.md -b=baseprint | ||
``` | ||
|
||
A baseprint is created in the subdirectory `baseprint` (containing a JATS XML file named `article.xml`). | ||
|
||
|
||
## Use with LaTeX | ||
|
||
Input files with the `.tex` suffix will be interpreted as LaTeX. | ||
LaTeX can also be embedded inside Markdown files. | ||
However, not all LaTeX is understood by `pandoc`. `basecast` is not | ||
running a traditional LaTeX compiler. It is merely calling `pandoc` | ||
to convert to JATS XML from LaTeX or markdown with embedded LaTeX. | ||
|
||
|
||
## Use with other LaTeX compilers and Overleaf | ||
|
||
`basecast` can be used in parallel with other LaTeX compilers such as those found on | ||
[Overleaf](https://www.overleaf.com/) (e.g. pdfLaTeX, LaTeX, XƎLaTeX, and LuaLaTeX). | ||
|
||
An approach that works well with a LaTeX compiler | ||
is to maintain separate `main.tex` and `doc.tex` files. | ||
The `doc.tex` file contains the content of the document whereas `main.tex` | ||
is a minimal wrapper that includes `doc.tex`. | ||
Only `doc.tex` is read by `pandoc` | ||
whereas `main.tex` is provided to a full LaTeX compiler (such as on Overleaf). | ||
LaTeX markup that is only needed for a full LaTeX compiler is kept in `main.tex`. | ||
LaTeX markup that is read by both `pandoc` and a full LaTeX compiler is placed in | ||
`doc.tex`. | ||
|
||
[Here is an example `main.tex`](examples/main.tex). | ||
|
||
The use of a Pandoc defaults file is very useful for handling | ||
separate files such as a `bibliography.bib` file. A Pandoc defaults | ||
file is also useful for setting JATS XML document metadata. | ||
|
||
A defaults file like [this example `pandocin.yaml` file](examples/pandocin.yaml) can be used as follows: | ||
|
||
``` | ||
basecast --defaults mydoc/pandocin.yaml -b=baseprint | ||
``` | ||
|
||
With this approach, the input file `doc.tex` can include a line of LaTeX such as | ||
`\addbibresource{references.bib}` and it will be found by `pandoc`. | ||
|
||
|
||
## Monitoring Input Files | ||
|
||
With the `-m` and `--monitor` options, folders or files will be continuously monitored | ||
for changes. Upon any folder or file change, the outputs (for baseprint, HTML, and/or | ||
PDF) will be automatically regenerated. | ||
|
||
When generating a PDF preview, some PDF applications will automatically refresh when | ||
showing a PDF file on a filesystem. | ||
For HTML outputs, a web server like the NPM package `live-server` can be very useful. | ||
There are many such web servers that will automatically refresh web pages in a web | ||
browser when the HTML files are updated. | ||
|
||
Press `CTRL-C` to stop `basecast` when running with `-m`/`--monitor`. | ||
|
||
WARNING: Some editors, like `vim` on Linux by default change files in a way that | ||
prevents the proper functioning of `-m`/`--monitor`. Either stick to monitoring a folder | ||
or in the case of `vim` use `set backupcopy=yes`. | ||
|
||
|
||
### Automatic web page refresh via container | ||
|
||
You can run both `basecast` with monitoring and a web server with automatic web page refresh | ||
by completing the [last optional step of the setup with | ||
containers](containers.md#step-four-optional). | ||
|
||
With the `live-basecast` shell function defined, you can run the shell command: | ||
|
||
``` | ||
live-basecast --defaults mydoc/pandocin.yaml --monitor mydoc -b=baseprint | ||
``` | ||
|
||
like `basecast` but a `-o=site` output option is automatically added. | ||
After running you can browse to `http://localhost:8080` to view an automatically | ||
refreshing HTML preview of the baseprint. | ||
--- | ||
template: redirect.html | ||
location: https://try.perm.pub/basecast/cli/ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters