Skip to content

Commit

Permalink
Merge pull request #204 from gnott/feature-appendix-content
Browse files Browse the repository at this point in the history
Appendices and boxes
  • Loading branch information
gnott committed Jul 7, 2017
2 parents e6dd1f5 + 6213cb8 commit 428b93d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions converter/elife_converter.js
Expand Up @@ -325,11 +325,15 @@ ElifeConverter.Prototype = function() {
switch(node.type) {
// Boxes go into the figures view if these conditions are met
// 1. box has a label (e.g. elife 00288)
// Disable it July 2017: cross reference links do not work if box reference
// in the content panel tries to link to the figures panel
/*
case "box":
if (node.label) {
state.doc.show("figures", node.id);
}
break;
*/
default:
__super__.showNode.apply(this, arguments);
}
Expand Down
6 changes: 4 additions & 2 deletions converter/lens_converter.js
Expand Up @@ -1329,11 +1329,13 @@ NlmToLensConverter.Prototype = function() {
// Assuming that there are no nested <boxed-text> elements
var childNodes = this.bodyNodes(state, util.dom.getChildren(box));
var boxId = state.nextId("box");
// Optional heading label
var label = this.selectDirectChildren(box, "label")[0];
var boxNode = {
"type": "box",
"id": boxId,
"source_id": box.getAttribute("id"),
"label": "",
"label": label ? label.textContent : "",
"children": _.pluck(childNodes, 'id')
};
doc.create(boxNode);
Expand Down Expand Up @@ -2224,7 +2226,7 @@ NlmToLensConverter.Prototype = function() {
"type" : "heading",
"id" : headingId,
"level" : 1,
"content" : title ? this.annotatedText(state, title, [headingId, "content"]) : "Appendix"
"content" : "Appendices"
});

this.show(state, [heading]);
Expand Down

0 comments on commit 428b93d

Please sign in to comment.