Skip to content

Commit 7a79f3f

Browse files
authored
Merge pull request #153 from cu-mkp/dev
EditionCrafter 1.1
2 parents 5a5b5db + a2eaa8b commit 7a79f3f

File tree

108 files changed

+42844
-45342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+42844
-45342
lines changed

.vscode/settings.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
11
{
2-
"editor.formatOnSave": false
2+
// Disable the default formatter, use eslint instead
3+
"prettier.enable": false,
4+
"editor.formatOnSave": false,
5+
6+
// Auto fix
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": "explicit",
9+
"source.organizeImports": "never"
10+
},
11+
12+
// Silent the stylistic rules in your IDE, but still auto fix them
13+
"eslint.rules.customizations": [
14+
{ "rule": "style/*", "severity": "off", "fixable": true },
15+
{ "rule": "format/*", "severity": "off", "fixable": true },
16+
{ "rule": "*-indent", "severity": "off", "fixable": true },
17+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
18+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
19+
{ "rule": "*-order", "severity": "off", "fixable": true },
20+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
21+
{ "rule": "*-newline", "severity": "off", "fixable": true },
22+
{ "rule": "*quotes", "severity": "off", "fixable": true },
23+
{ "rule": "*semi", "severity": "off", "fixable": true }
24+
],
25+
26+
// Enable eslint for all supported languages
27+
"eslint.validate": [
28+
"javascript",
29+
"javascriptreact",
30+
"typescript",
31+
"typescriptreact",
32+
"vue",
33+
"html",
34+
"markdown",
35+
"json",
36+
"jsonc",
37+
"yaml",
38+
"toml",
39+
"xml",
40+
"gql",
41+
"graphql",
42+
"astro",
43+
"svelte",
44+
"css",
45+
"less",
46+
"scss",
47+
"pcss",
48+
"postcss"
49+
]
350
}

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The following props are available to the `<EditionCrafter>` viewer component:
6262

6363
### documentInfo
6464

65-
Optional; used **only** in the case that you wish to load multiple documents in the same viewer for easy comparison.
65+
Optional; used **only** in the case that you wish to load multiple documents in the same viewer for easy comparison.
6666

6767
An *object* whose keys are unique document IDs for each document you wish to include, and whose values are *objects* specifying the `documentName`, `transcriptionTypes`, and `iiifManifest` for each document as described below. For example:
6868
```js
@@ -89,7 +89,7 @@ documentInfo={{
8989

9090
Required. (Note: This is required even in the case that you have also included a `documentInfo` prop.)
9191

92-
A *string* giving the name of the document(s).
92+
A *string* giving the name of the document(s).
9393

9494
### glossaryURL
9595

@@ -177,3 +177,11 @@ Setup for Storybook was kind of rushed and the process could still be made simpl
177177
By default, Storybook doesn't display the hash routing params used by `react-router`. You can use the "Open canvas in new tab" button on the top right to open the component in its own tab:
178178

179179
![screenshot of new tab button](newtab.png)
180+
181+
## Releasing a new version
182+
183+
1. Bump the package numbers in `editioncrafter/package.json` and `editioncrafter-umd/package.json`.
184+
2. In the root level of the repo, run `npm run build` to make sure all changes are reflected in the `package-lock.json` files.
185+
3. Commit these changes to `dev`, then merge `dev` into `main`.
186+
4. Create a new GitHub [release](https://github.com/cu-mkp/editioncrafter/releases) pointing to `main` with a version tag matching what you chose in step 1. Make sure to include a list of changes.
187+
5. The GitHub workflow will run automatically to publish the packages. Make sure that [editioncrafter](https://www.npmjs.com/package/@cu-mkp/editioncrafter) and [editioncrafter-umd](https://www.npmjs.com/package/@cu-mkp/editioncrafter-umd) have been successfully published.

astro-web/src/pages/getting-started/index.mdx

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ layout: ../../layouts/Docs.astro
55

66
Welcome to the "Getting Started Guide" for EditionCrafter. This guide describes how to include EditionCrafter in your website. In order to do so, you must first create the artifacts EditionCrafter needs to work. These artifacts are a set of JSON, HTML, and XML files generated from a [TEI Document](https://www.tei-c.org/release/doc/tei-p5-doc/en/html/index.html) that you supply. You can use the [EditionCrafter CLI](https://www.npmjs.com/package/@cu-mkp/editioncrafter-cli) to create all of these artifacts and a starting TEI Document in the correct format, based on a [IIIF Manifest](https://iiif.io/guides/using_iiif_resources/).
77

8+
If you don't have a TEI Document yet, don't worry, the command line tool can help you create one. You can create a TEI Document from a list of images or from a IIIF Manifest. The EditionCrafter CLI will generate a TEI Document that includes all of the images in the IIIF Manifest you provide. You can even provide plain text transcriptions to include in your TEI Document.
9+
810
In order to use EditionCrafter, you will also need to publish the EditionCrafter artifacts online, either on your edition website or on a separate data site. GitHub Pages is a no-cost way to accomplish this. However, documenting the use of git and GitHub Pages is beyond the scope of this guide. You can see examples of this pattern [here](https://github.com/cu-mkp/editioncrafter-data).
911

10-
You will also need a website where EditionCrafter will display your edition. We provide instructions for how to install EditionCrafter in a React app and in a HTML website. Lastly, the page images of your text need to be available online on a IIIF Image server. You can often obtain a link to your page images from the institution that is holding the originals. Heres a good place to [start](https://iiif.io/guides/finding_resources/).
12+
You will also need a website where EditionCrafter will display your edition. We provide instructions for how to install EditionCrafter in a React app and in a HTML website. Lastly, the page images of your text need to be available online on a IIIF Image server. You can often obtain a link to your page images from the institution that is holding the originals. Here's a good place to [start](https://iiif.io/guides/finding_resources/).
1113

1214
## Installing the EditionCrafter CLI
1315

@@ -23,20 +25,46 @@ To test it out, try the command below, which displays the CLI documentation in t
2325
editioncrafter help
2426
```
2527

28+
## Creating a TEI Document from a List of Images
29+
30+
If you are starting with a list of images, you can use the EditionCrafter CLI to generate a TEI Document for you based on your images. To do this, create a CSV file that lists the images in your document. You can generate a CSV file from an Excel spreadsheet or a Google Sheet.
31+
32+
The CSV file should have the following columns: `url`, `label`, and `xml_id`. The `url` column should contain the URL of the image, the `label` column should contain a label for the image, and the `xml_id` column should contain a unique identifier for the image. This ID will be used as the `xml:id` attribute for each surface and can be referenced when adding plain text transcriptions.
33+
34+
Once you have created this file, you can generate a TEI Document by running the following command:
35+
36+
```
37+
editioncrafter images -i <images.csv> -o <output.xml>
38+
```
39+
2640
## Creating a TEI Document from your IIIF Manifest
2741

28-
To prepare a TEI Document to use with EditionCrafter, you should first add all of the images to a `<facsimile>` element in the document. To aid in this process, you can use the CLI to generate one for you based on your IIIF Manifest:
42+
If you are starting with a IIIF Manifest, you can use the EditionCrafter CLI to generate a TEI Document for you based on your IIIF Manifest:
2943

3044
```
31-
editioncrafter iiif <iiif_url> <output_path>
45+
editioncrafter iiif -i <iiif_url> -o <output.xml>
3246
```
3347

3448
This creates an XML file on your computer at the output file path based on the IIIF Manifest that you point to in the `<iiif_url>`. In a separate section below, we will describe how to edit this structure to fill in the textual content of your edition. Before we do that, let's finish setting things up.
3549

36-
The next step is to generate the EditionCrafter artifacts needed to display the document on the web. We do that with this command:
50+
In `iiif` mode, the XML ID for each generated surface will be `f000` for the first surface, `f001` for the second, and so on. This ID will be used as the `xml:id` for each surface and can also be referenced when adding plain text transcriptions.
51+
52+
## Adding Plain Text transcriptions
53+
54+
If you have plain text transcriptions of your document, you can include them in the TEI Document that you are creating. To do this, create a folder on your computer that contains a text file for each page of your document. The text files should be named in the following format: `<xml_id>.txt`. For example, if you have a transcription for page 3 of your document and it has the ID of `f003`, the file should be named `f003.txt`. Once you have created these files, you can include them in the TEI Document by running the following command:
55+
56+
```
57+
editioncrafter iiif -i <iiif_url> -o <output.xml> -t <transcription_folder_path>
58+
```
59+
60+
Note: The `-t` flag works with both the `iiif` and `images` commands.
61+
62+
## Processing a TEI Document to create EditionCrafter artifacts
63+
64+
Once you have a TEI Document in the correct format, the next step is to generate the EditionCrafter artifacts needed to display the document on the web. We do that with this command:
3765

3866
```
39-
editioncrafter process <tei_file> <output_path> <base_url>
67+
editioncrafter process -i <tei_file> -o <output_path> -u <base_url>
4068
```
4169

4270
This creates the necessary artifacts at the `<output_path>`. These artifacts include a new IIIF Manifest that is now annotated with web annotations that link each page of the text with the corresponding HTML and XML renderings of that page. You will want to point to this manifest from the EditionCrafter viewer component. Once you have published these files online at the `<base_url>`, you are ready for the next step.
@@ -153,38 +181,6 @@ You could begin page 3r in your text like this:
153181

154182
Additional functionality can be triggered by specific elements and attributes. See the TEI reference section for more information.
155183

156-
# Reference
157-
158-
This section provides further details on the commands available to the EditionCrafter CLI and the configuration options available to the EditionCrafter viewer.
159-
160-
## EditionCrafter CLI Reference
161-
162-
The following commands are available to the EditionCrafter CLI:
163-
164-
### help
165-
166-
Usage:
167-
```
168-
editioncrafter help
169-
```
170-
This will display information on the syntax for passing commands to the CLI as well as a list of available commands.
171-
172-
### iiif
173-
174-
Usage:
175-
```
176-
editioncrafter iiif <iiif_url> <output_path>
177-
```
178-
This will create an XML file at the location of the provided `<output_path>` based on the information in the IIIF manifest supplied. Note that in this case the `<output_path>` should be a single XML File, e.g. `/MyFiles/TEI/index.xml`.
179-
180-
### process
181-
182-
Usage:
183-
```
184-
editioncrafter process <tei_file> <output_path> <base_url>
185-
```
186-
This will create all of the artifacts that EditionCrafter needs in order to display your document on the web, and place them in the specified `<output_path>` folder. The `<base_url>` parameter should be the URL at which you intend to host these artifacts.
187-
188184
## EditionCrafter Viewer Reference
189185

190186
The following props are available to the `<EditionCrafter>` viewer component:

editioncrafter-umd/babel.config.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)