Skip to content

Commit

Permalink
Use author-meta / date-meta to remove sed (#37)
Browse files Browse the repository at this point in the history
Refs manubot/rootstock#32 (comment)

Also ignore manuscript.docx output
  • Loading branch information
ploegieku authored Jul 21, 2017
1 parent 31f69c9 commit f907b08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated manuscript output files
output/index.html
output/manuscript.pdf
output/manuscript.docx
output/*.ots

# Generated reference files
Expand Down
5 changes: 0 additions & 5 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ pandoc --verbose \
--output=output/index.html \
$INPUT_PATH

# Remove h2 author names and h3 date from HTML body but
# keep as metadata in the head.
sed --in-place '/<h2 class="author">/d' output/index.html
sed --in-place '/<h3 class="date"/d' output/index.html

# Create PDF output
echo "Exporting PDF manuscript"
wkhtmltopdf \
Expand Down
7 changes: 3 additions & 4 deletions build/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,12 @@ def get_standard_citatation(citation, cache, override):

# Add date to metadata
today = datetime.date.today()
today = today.strftime('%B %e, %Y')
metadata['date'] = today
stats['date'] = today
metadata['date-meta'] = today.isoformat()
stats['date'] = today.strftime('%B %e, %Y')

# Author table information
authors = metadata.pop('author_info')
metadata['author'] = [author['name'] for author in authors]
metadata['author-meta'] = [author['name'] for author in authors]
stats['authors'] = authors

# Set repository version metadata for CI builds only
Expand Down

0 comments on commit f907b08

Please sign in to comment.