Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
reading-scholarly-articles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jean Michel Rouly
reading-scholarly-articles
Commits
fd436baf
Commit
fd436baf
authored
Aug 19, 2014
by
Jean Michel Rouly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split big annotations.json file into smaller, field-dependent ones.
parent
a61ca1fb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
43 deletions
+8
-43
annotations.json
annotations.json
+0
-38
build.sh
build.sh
+4
-1
layout/article.html
layout/article.html
+1
-1
static/js/annotations.js
static/js/annotations.js
+3
-3
No files found.
annotations.json
deleted
100644 → 0
View file @
a61ca1fb
{
"cs"
:
[
],
"edu"
:
[
],
"eng"
:
[
],
"gov"
:
[
],
"hist"
:
[
],
"lit"
:
[
],
"med"
:
[
],
"psy"
:
[
],
"sci"
:
[
],
"sample"
:
[
{
"id"
:
"#title"
,
"title"
:
"Title"
,
"string"
:
"The title of a scholarly article is generally (but not always) an extremely brief summary of the article's contents. It will usually contain technical terms related to the research presented."
}
]
}
build.sh
View file @
fd436baf
...
...
@@ -9,11 +9,11 @@ echo "Cleaning build directory."
clean.sh
mkdir
-p
tmp
mkdir
-p
webroot
mkdir
-p
webroot/json
echo
"Copying static files into webroot."
cp
-r
static webroot/
cp
-r
annotations.json webroot/
echo
"Building articles."
for
article
in
pages/articles/
*
...
...
@@ -27,12 +27,14 @@ do
ARTICLE_FILE
=
"pages/articles/
$ID
/article"
OVERVIEW_FILE
=
"pages/articles/
$ID
/overview"
COPYRIGHT_FILE
=
"pages/articles/
$ID
/copyright"
ANNOTATIONS_FILE
=
"pages/articles/
$ID
/annotations.json"
echo
" Checking file presence."
if
[
!
-f
$TITLE_FILE
]
;
then
echo
"No file
$TITLE_FILE
found. Exiting."
;
exit
;
fi
if
[
!
-f
$OVERVIEW_FILE
]
;
then
echo
"No file
$OVERVIEW_FILE
found. Exiting."
;
exit
;
fi
if
[
!
-f
$ARTICLE_FILE
]
;
then
echo
"No file
$ARTICLE_FILE
found. Exiting."
;
exit
;
fi
if
[
!
-f
$COPYRIGHT_FILE
]
;
then
echo
"No file
$COPYRIGHT_FILE
found. Exiting."
;
exit
;
fi
if
[
!
-f
$ANNOTATIONS_FILE
]
;
then
echo
"No file
$ANNOTATIONS_FILE
found. Exiting."
;
exit
;
fi
echo
" Reading data."
TITLE
=
$(
cat
$TITLE_FILE
)
...
...
@@ -55,6 +57,7 @@ do
echo
" Moving into webroot."
mv
"tmp/
$ID
.html"
webroot/
cp
$ANNOTATIONS_FILE
"webroot/json/
$ID
.json"
ASSETS
=
"pages/articles/
$ID
/assets"
if
[
-e
$ASSETS
]
...
...
layout/article.html
View file @
fd436baf
...
...
@@ -52,5 +52,5 @@
</div>
<script>
getAnnotations
(
"
{{ ID }}
"
);
getAnnotations
(
"
json/{{ ID }}.json
"
);
</script>
static/js/annotations.js
View file @
fd436baf
...
...
@@ -11,14 +11,14 @@ function getAnnotations( field ) {
*/
$
.
getJSON
(
"
annotations.json
"
,
field
,
function
(
data
)
{
// Read in the dictionary of annotations from a central JSON
// dictionary.
console
.
log
(
"
Successfully read in JSON annotations.
"
);
// Grab only the annotations for this specific field.
var
annotations
=
data
[
field
];
var
annotations
=
data
[
'
annotations
'
];
// Verify that the field name was valid and annotations were found.
if
(
!
annotations
)
{
...
...
@@ -27,7 +27,7 @@ function getAnnotations( field ) {
return
;
}
console
.
log
(
"
Found
'
"
+
field
+
"
'
in JSON dictionary.
"
);
console
.
log
(
"
Found
valid annotations
in JSON dictionary.
"
);
// Loop over each annotation found and set its trigger's alt text as
// well as define the popover for it.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment