Skip to content

Commit c0c58f6

Browse files
committed
Rename JATS4R to DarArticle.
1 parent 3571f71 commit c0c58f6

14 files changed

+49
-50
lines changed

data/kitchen-sink/manuscript.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE article PUBLIC "JATS4R 1.1" "http://texture.substance.io/JATS4R-1.1.dtd">
2+
<!DOCTYPE article PUBLIC "DarArticle 1.1" "http://texture.substance.io/DarArticle-1.1.dtd">
33
<article id="article" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<front id="front-1">
55
<article-meta id="article-meta-1">

make.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const RNG_SEARCH_DIRS = [
1414
const RNG_FILES = [
1515
'src/article/JATS-publishing.rng',
1616
'src/article/JATS-archiving.rng',
17-
'src/article/JATS4R.rng',
17+
'src/article/DarArticle.rng',
1818
'src/article/TextureJATS.rng'
1919
]
2020

@@ -40,8 +40,8 @@ b.task('compile:jats', () => {
4040
_compileSchema('JATS-archiving', RNG_FILES[1], RNG_SEARCH_DIRS, RNG_FILES.slice(1,2))
4141
})
4242

43-
b.task('compile:jats4r', () => {
44-
_compileSchema('JATS4R', RNG_FILES[2], RNG_SEARCH_DIRS, RNG_FILES.slice(0,3))
43+
b.task('compile:dar-article', () => {
44+
_compileSchema('DarArticle', RNG_FILES[2], RNG_SEARCH_DIRS, RNG_FILES.slice(0,3))
4545
})
4646

4747
b.task('compile:texture-jats', () => {
@@ -51,11 +51,11 @@ b.task('compile:texture-jats', () => {
5151
b.task('compile:debug', () => {
5252
_compileSchema('JATS-publishing', RNG_FILES[0], RNG_SEARCH_DIRS, RNG_FILES.slice(0,1), { debug: true })
5353
_compileSchema('JATS-archiving', RNG_FILES[1], RNG_SEARCH_DIRS, RNG_FILES.slice(1,2), { debug: true })
54-
_compileSchema('JATS4R', RNG_FILES[2], RNG_SEARCH_DIRS, RNG_FILES.slice(0,3), { debug: true })
54+
_compileSchema('DarArticle', RNG_FILES[2], RNG_SEARCH_DIRS, RNG_FILES.slice(0,3), { debug: true })
5555
_compileSchema('TextureJATS', RNG_FILES[3], RNG_SEARCH_DIRS, RNG_FILES.slice(0,4), { debug: true })
5656
})
5757

58-
b.task('compile:schema', ['compile:jats', 'compile:jats4r', 'compile:texture-jats'])
58+
b.task('compile:schema', ['compile:jats', 'compile:dar-article', 'compile:texture-jats'])
5959

6060
b.task('build:browser', ['compile:schema'], () => {
6161
_buildLib(DIST, 'browser')

src/article/DarArticle.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { XMLSchema } from 'substance'
2+
import DarArticleData from '../../tmp/DarArticle.data'
3+
4+
const DarArticle = XMLSchema.fromJSON(DarArticleData)
5+
6+
7+
// TODO: this should come from compilation
8+
DarArticle.getName = function() {
9+
return 'DarArticle'
10+
}
11+
12+
DarArticle.getVersion = function() {
13+
return '1.1'
14+
}
15+
16+
DarArticle.getDocTypeParams = function() {
17+
return ['article', 'DarArticle 1.1', 'http://texture.substance.io/DarArticle-1.1.dtd']
18+
}
19+
20+
export default DarArticle

src/article/JATS4R.rng renamed to src/article/DarArticle.rng

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
</element>
153153
</define>
154154

155-
<!-- in JATS4R we want to have simpler phrase content -->
155+
<!-- in DarArticle we want to have simpler phrase content -->
156156
<define name="all-phrase">
157157
<choice>
158158
<ref name="simple-phrase"/>
@@ -304,7 +304,7 @@
304304
</zeroOrMore>
305305
</define>
306306
307-
With JATS4R we will try to introduce a restrictive yet expressive
307+
With DarArticle we will try to introduce a restrictive yet expressive
308308
schema.
309309
310310
TODO: add transformation

src/article/JATS4R.js

-20
This file was deleted.

src/article/TextureJATS.rng

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
77

88
<!-- Stubs -->
9-
<include href="JATS4R.rng"/>
9+
<include href="DarArticle.rng"/>
1010

1111
<!--
1212
Element-Type Overrides: These are necessary to generate
@@ -591,7 +591,7 @@
591591
<!-- WIP
592592
Refactored def-list, def, term et. al
593593
594-
TODO: check if this is really workable, and add this to JATS4R if good
594+
TODO: check if this is really workable, and add this to DarArticle if good
595595
-->
596596
<define name="def-list-model">
597597
<optional>

src/article/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export { default as JATS } from './JATS'
22
export { default as JATSArchiving } from './JATSArchiving'
33
export { default as JATSPublishing } from './JATSPublishing'
4-
export { default as JATS4R } from './JATS4R'
4+
export { default as DarArticle } from './DarArticle'
55
export { default as TextureJATS } from './TextureJATS'
66
export { default as TextureDocument } from './TextureDocument'
77
export { default as TextureHTMLConverters } from './TextureHTMLConverters'

src/converter/JATSExporter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { t2r } from './r2t'
22
import { validateXMLSchema } from 'substance'
3-
import { JATS4R } from '../article'
3+
import { DarArticle } from '../article'
44

55
export default class JATSExporter {
66
/*
77
Takes a TextureJATS document as a DOM and transforms it into a JATS document,
8-
following JATS4R guidelines.
8+
following DarArticle guidelines.
99
*/
1010
export(dom, context = {}) {
1111
let pubMetaDb = context.pubMetaDb
@@ -25,7 +25,7 @@ export default class JATSExporter {
2525
const api = this._createAPI(state)
2626

2727
t2r(dom, api)
28-
let res = validateXMLSchema(JATS4R, dom)
28+
let res = validateXMLSchema(DarArticle, dom)
2929
if (!res.ok) {
3030
res.errors.forEach((err) => {
3131
console.error(err.msg, err.el)

src/converter/JATSImportDialog.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class ImportStage extends Component {
5555
const TITLES = {
5656
'parse': 'Parse XML',
5757
'validate-jats': 'Validate JATS',
58-
'validate-jats4r': 'Validate JATS4R',
58+
'validate-dar-article': 'Validate DarArticle',
5959
'validate-texture-jats': 'Validate TextureJATS',
60-
'j2r': 'Transform JATS -> JATS4R',
61-
'r2t': 'Transform JATS4R -> TextureJATS'
60+
'j2r': 'Transform JATS -> DarArticle',
61+
'r2t': 'Transform DarArticle -> TextureJATS'
6262
}
6363

6464
function _getTitle(stage) {

src/converter/JATSImporter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
EventEmitter, DefaultDOMElement,
33
validateXMLSchema, isString
44
} from 'substance'
5-
import { JATS, JATS4R, TextureJATS } from '../article'
5+
import { JATS, DarArticle, TextureJATS } from '../article'
66
import { r2t } from './r2t'
77
import { j2r } from './j2r'
88
import custom from './custom'
@@ -30,7 +30,7 @@ export default class JATSImporter extends EventEmitter {
3030
'validate-jats': [],
3131
'custom': [],
3232
'j2r': [],
33-
'validate-jats4r': [],
33+
'validate-dar-article': [],
3434
'r2t': [],
3535
'validate-texture-jats': [],
3636
},
@@ -59,7 +59,7 @@ export default class JATSImporter extends EventEmitter {
5959
// JATS -> restricted JATS
6060
if (!this._transform('j2r', state)) return state
6161

62-
if (!this._validate(JATS4R, state)) return state
62+
if (!this._validate(DarArticle, state)) return state
6363

6464
// restrictedJATS -> TextureJATS
6565
if (!this._transform('r2t', state)) return state

src/converter/j2r/PruneText.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pruneText from '../util/pruneText'
2-
import { JATS4R } from '../../article'
2+
import { DarArticle } from '../../article'
33

44
/*
55
Removes all native TextNodes from elements which we specified to be
@@ -8,11 +8,10 @@ import { JATS4R } from '../../article'
88
export default class PruneText {
99

1010
import(dom) {
11-
pruneText(dom.find('article'), JATS4R)
11+
pruneText(dom.find('article'), DarArticle)
1212
}
1313

1414
export() {
1515
// nothing
1616
}
1717
}
18-

src/converter/r2t/ConvertSigBlock.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// in JATS4R we propose sig-block := sig+
1+
// in DarArticle we propose sig-block := sig+
22
// ATM, we are not good in editing a container like element
33
// that uses something else than paragraphs
44
// TODO: we should allow to customize the Editing behavior just for
@@ -57,4 +57,4 @@ function _exportSig(sig) {
5757
}
5858
sig.empty()
5959
sig.append(content)
60-
}
60+
}

src/converter/r2t/UnifyPublicationHistory.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JATS4R } from '../../article'
1+
import { DarArticle } from '../../article'
22

33
/*
44
For sake of simplicity we want to use only <history>
@@ -15,7 +15,7 @@ export default class UnifyPublicationHistory {
1515
let history = dom.find('article-meta > history')
1616
if (!history) {
1717
history = dom.createElement('history')
18-
let pos = JATS4R.getElementSchema('article-meta').findFirstValidPos(articleMeta, 'history')
18+
let pos = DarArticle.getElementSchema('article-meta').findFirstValidPos(articleMeta, 'history')
1919
articleMeta.insertAt(pos, history)
2020
}
2121
pubDates.forEach((pubDate) => {
@@ -30,7 +30,7 @@ export default class UnifyPublicationHistory {
3030
let articleMeta = dom.find('article-meta')
3131
let history = dom.find('article-meta > history')
3232
let dates = history.findAll('date')
33-
let schema = JATS4R.getElementSchema('article-meta')
33+
let schema = DarArticle.getElementSchema('article-meta')
3434
let pos = schema.findFirstValidPos(articleMeta, 'pub-date')
3535
for (let i = dates.length - 1; i >= 0; i--) {
3636
let date = dates[i]

src/converter/r2t/UpdateDocType.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TextureJATS, JATS4R } from '../../article'
1+
import { TextureJATS, DarArticle } from '../../article'
22

33
export default class UpdateDocType {
44

@@ -10,7 +10,7 @@ export default class UpdateDocType {
1010

1111
export(dom) {
1212
dom.setDocType(
13-
...JATS4R.getDocTypeParams()
13+
...DarArticle.getDocTypeParams()
1414
)
1515
}
1616
}

0 commit comments

Comments
 (0)