Commit 33ea997f authored by Ian Dennis Miller's avatar Ian Dennis Miller
Browse files

Merge branch 'idm-master-patch-83769' into 'master'

Simplify config

See merge request !2
parents 918a8026 c333bf4e
......@@ -24,9 +24,9 @@ python -c "import nltk; nltk.download('punkt')"
```sh
mkdir build src
visfact-scaffold-config.py config.yaml
visfact-scaffold-article.py src/article.ttl
visfact-scaffold-article.py article.ttl
visfact-make.py config.yaml
open build/output.html
open output.html
```
Arrow keys are used to navigate the fact cards:
......@@ -43,23 +43,44 @@ Snippets must be installed in your text editor.
### Workflow
1. `visfact-scaffold-article.py article.ttl`
2. Open `article.ttl` file in text editor
1. Scaffold a new article with `visfact-scaffold-article.py article-1.ttl`
2. Open `article-1.ttl` file in text editor
3. Enter the DOI, title, authors, and year.
4. Use `cite`, `self`, and `src` to populate the rest of the file with quotes.
4. Use `quote`, `self`, and `src` to populate the rest of the file with quotes.
### Config
1. `visfact-scaffold-config.py config.yaml`
2. Open `visfact.yaml` in the text editor
4. provide the path to the `article.ttl` files
2. Open `config.yaml` in the text editor
3. Provide the path to `article-1.ttl` and other files
### Running
### Building
```sh
visfact-make.py config.yaml
```
## Argument files
Arguments consist of claims that are represented as terse triples.
Please see [example/article-1.ttl](example/article-1.ttl) for a complete example.
## Configuration
A YAML file is used to control visfact.
The following YAML corresponds to [example/config.yaml](example/config.yaml) in the Usage example.
The configuration specifies which files to load (enumerated as a list under the `files:` heading).
The configuration also specifies a destination, called `dest`, to write the output HTML into.
```yaml
---
title: "example argument"
files:
- "article-1.ttl"
dest: "output.html"
rdf: "output.rdf"
```
## Text Editor Support
Use snippets to reduce repetitive typing and to generally go faster.
......@@ -67,7 +88,7 @@ Snippets are text macros that expand to produce the necessary Turtle for adding
Snippets are provided for some text editors.
Commands are also available to clean up snippets as they are used.
### Usage
### Available snippets
These snippets are provided:
......@@ -85,7 +106,6 @@ These commands are provided:
Invoke command with the command pallet: `cmd-shift-p` `thesis`
### Sublime Text 3
#### Installation
......@@ -130,62 +150,6 @@ Enable tab completion in `settings.json`:
4. **Replace Rules -- Rules -- edit in settings.json**
5. copy-paste contents of `settings.json` (pay attention to JSON commas)
## Configuration
A YAML file is used to control visfact.
The following YAML corresponds to `example/visfact.yaml` in the Usage example.
The configuration specifies which files to load (enumerated as a list under the `files:` heading).
The configuration also specifies a destination, called `dest`, to write the output HTML into.
```yaml
---
title: "example argument - visfact"
files:
- "src/article-1.ttl"
dest: "argument-1.html"
rdf: "argument-1.rdf"
```
## Argument files
Arguments consist of claims that are represented as terse triples.
The following Turtle corresponds to `example/argument-1/article-1.ttl`, which is referenced by the example configuration file.
```turtle
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix thesis: <https://projects.sisrlab.com/idm/visfact/raw/master/schema/thesis.rdf#> .
<#article-1>
a thesis:article ;
dc:title "The Major Work" ;
dc:authors "Author Y & Author Z" ;
dc:url "https://doi.org/" ;
dc:year 2019 .
[ a thesis:claim ;
thesis:appearance <#article-1> ;
thesis:quote "This new fact is justified by this article, itself." ;
thesis:note "I have a thought." ;
thesis:source <#article-1> ;
] .
[ a thesis:claim ;
thesis:appearance <#article-1> ;
thesis:quote "This fact, quoted from Article 1, is justified by two sources." ;
thesis:source [ a thesis:article ;
dc:authors "Author A, Author B" ;
dc:title "A Profound Work" ;
dc:year 2018 ;
] ;
thesis:source [ a thesis:article ;
dc:authors "Author C, Author D" ;
dc:title "A Good Work" ;
dc:year 2017 ;
] ;
] .
```
## Design Objectives
- reduce cognitive load: fewer memory tasks
......
---
title: "example argument"
files:
- "article-1.ttl"
dest: "output.html"
rdf: "output.rdf"
---
title: "example argument - visfact"
files:
- "example/argument-1/article-1.ttl"
dest: "build/argument-1.html"
rdf: "build/argument-1.rdf"
---
title: "example argument - visfact"
title: "example argument"
files:
- "src/article.ttl"
dest: "build/argument-1.html"
rdf: "build/argument-1.rdf"
- "article-1.ttl"
dest: "output.html"
rdf: "output.rdf"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment