Giter VIP home page Giter VIP logo

softwaresaved / software-deposit-guidance Goto Github PK

View Code? Open in Web Editor NEW
0.0 11.0 1.0 6.32 MB

Software Deposit Guidance for Researchers. Contact: mikej888

Home Page: https://softwaresaved.github.io/software-deposit-guidance

License: Other

Shell 3.73% Makefile 23.72% HTML 18.57% Python 32.66% CSS 21.33%
reproducible-research guidelines deposit digital-repository research-data-management research-software

software-deposit-guidance's Introduction

Software Deposit: Guidance for Researchers (source code)

The Software Sustainability Institute.

Sources for softwaresaved.github.io/software-deposit-guidance/


About these instructions

  • These instructions were tested on Ubuntu 16.04.3 LTS xenial.
  • Other versions of the tools may also be usable.
  • Installing tools requires you to have sudo access to install and configure software (or a local system administrator to do this for you):
sudo su -

Install dependencies

Install Pandoc document converter:

sudo apt-get install pandoc
pandoc --version
pandoc 1.16.0.2

Install wkhtmltopdf HTML-to-PDF converter (using latest stable version, 0.12.5, for Ubuntu 16.04 Xenial, on web site):

wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb
sudo apt install ./wkhtmltox_0.12.5-1.xenial_amd64.deb 
wkhtmltopdf  --version
wkhtmltopdf 0.12.5 (with patched qt)

Install Anaconda Python 2.7:

  • If you already have Python you can skip this step.
wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh
bash Anaconda2-5.2.0-Linux-x86_64.sh
  • Create: anaconda2.sh, with content:
export PATH=~/anaconda2/bin:$PATH
  • Set environment:
source anaconda2.sh

Install pyyaml:

  • If you have Anaconda Python you can skip this step.
pip install pyyaml

Install Microsoft TrueType core fonts:

apt-get install ttf-mscorefonts-installer

Install linkchecker 9.4:

wget https://github.com/linkchecker/linkchecker/archive/v9.4.0.tar.gz
tar -xf v9.4.0.tar.gz 
cd linkchecker-9.4.0/
pip install -r requirements.txt 
python setup.py install
linkchecker -V
LinkChecker 9.4.0 released xx.xx.xxxx
Copyright (C) 2000-2014 Bastian Kleineidam

Edit guides

Guides are written in Pandoc's Markdown.

The guides are in markdown/

For a check/tick mark in HTML, use the HTML entity, ✔, in Markdown.


Edit HTML template

The HTML template is in templates/doc.html. This was edited from a template created by pandoc -D html.


Edit images

Image sources are in images-src/ as SVG files.

Inkscape is a free SVG editor which can be used to edit these files and export the images as PNG files.

Once you have edited an SVG, export the SVG as a PNG file and save it in images/. This can be done in Inkscape using the command File => Export PNG Image...

To avoid memory issues when creating PDFs, set the longest dimension of the PNG file to be 1000 pixels at 96 dpi. For example, if the image is 1234x567 set the width to 1000, if the image is 123x4567 set the height to 1000. Remember to lock the aspect ratio.


Create PDF guides

Edit config.yml:

  • Ensure this line is commented-out. If not then do so.
# LINK_URL: . 
  • Ensure this line is uncommented. If not then do so.
LINK_URL: http://softwaresaved.github.io/software-deposit-guidance 

This ensures any hyperlinks between guides are absolute.

Run:

make pdf

This will process all the files in markdown/ and create PDFs in build/pdf/. As an intermediate stage, it will create HTML documents in build/html/. These will have absolute URLs for inter-guide links. To create HTML documents with relative inter-guide links (e.g. for hosting on a web site) see the next section.

Troubleshooting

If you see an error like:

terminate called after throwing an instance of 'std::bad_alloc'Page 2 of 5
  what():  std::bad_alloc
Makefile:57: recipe for target 'build/pdf/<FILENAME>.pdf' failed
make: *** [build/pdf/<FILENAME>.pdf] Aborted (core dumped)
make: *** Deleting file 'build/pdf/<FILENAME>.pdf'

then it may be that one or more image files used in the guide are too big and causing wkhtmltopdf, which creates PDFs, to run out of memory. Try resizing the images and try again.


Create HTML guides

Edit config.yml:

  • Ensure this line is commented-out. If not then do so.
# LINK_URL: http://softwaresaved.github.io/software-deposit-guidance 
  • Ensure this line is uncommented. If not then do so.
LINK_URL: . 

This ensures any hyperlinks between guides are relative and suitable for online publication.

Run:

make html

This will process all the files in markdown/ and create HTML documents in `build/html/.


Check links

Run:

make check-links

This will display broken links, if any.

If you see an error e.g.

Makefile:66: recipe for target 'check-links' failed
make: [check-links] Error 1 (ignored)

then this can be ignored (an error code of 1 means that the linkchecker program encountered one or more broken links).

A full report is created in build/link-check.txt.

Beware: Certain links may be identified as broken when they in fact exist. See the Linkchecker FAQ, Q:I still get an error, but the page is definitely ok.


Publish online

The online version of the guidance is published in the gh-pages branch of this repository. This can be updated as follows.

Create HTML guides, with relative inter-guide links, as described above.

Copy HTML into gh-pages branch and commit:

git checkout gh-pages
cp -r build/html/* .
git add *.html css imges
git commit -m "Updated guidance ..."

Deposit in Zenodo (for information only)

Zenodo metadata:

  • Communities: Research Data Network
  • Upload type: Publication (for guides), Software (for source)
  • Publication type: Working paper
  • Click Digital Object Identifier => Reserve DOI
  • Publication date: 2018-08-07
  • Title:
  • Authors:
  • Description:
  • Version: 1.0
  • Keywords:
    • research software
    • research outputs
    • repositories
    • digital preservation
    • software sustainability
    • software sustainability institute
  • Additional notes: This work was funded by Jisc. The Software Sustainability Institute is supported by EPSRC grant EP/H043160/1 and EPSRC/BBSRC and ESRC grant EP/N006410/1.
  • Funding: delete default entry.
  • Related/alternate identifiers:
    • For each guide, add: "SOURCE-CODE-DOI" "complied/created this upload"
    • For source code deposit, add, for each guide, "GUIDE-DOI" "is compiled/create by this upload"
    • For "Software Deposit: Guidance for Researchers" deposit, add, for each other guide, "GUIDE-DOI" "is a supplement to this upload"

Convert Word to Markdown (for information only)

The guidance was originally written in Microsoft Word then uploaded to Google Drive for community feedback. The Google Docs were then downloaded as Microsoft Word .docx files. These were then converted into Markdown using word-to-markdown as follows.

Install dependencies:

sudo apt install ruby
sudo apt install ruby-dev
sudo apt install zlib1g-dev
sudo gem install word-to-markdown

Convert documents to Markdown:

source scripts/word_to_markdown.sh ~/guidance/*docx
Converting /home/user/guidance/Guidance.docx
Converting /home/user/guidance/HowToChooseSoftwareLicence.docx
Converting /home/user/guidance/HowToDeposit.docx
Converting /home/user/guidance/HowToDescribeDeposit.docx
Converting /home/user/guidance/HowToReviewDeposit.docx
Converting /home/user/guidance/WhatNotToDeposit.docx
Converting /home/user/guidance/WhatToDeposit.docx
Converting /home/user/guidance/WhenToDeposit.docx
Converting /home/user/guidance/WhereToDeposit.docx
Converting /home/user/guidance/WhyDeposit.docx
ls markdown/
Guidance.md                    HowToReviewDeposit.md  WhereToDeposit.md
HowToChooseSoftwareLicence.md  WhatNotToDeposit.md    WhyDeposit.md
HowToDeposit.md                WhatToDeposit.md
HowToDescribeDeposit.md        WhenToDeposit.md

The Markdown was then manually edited to clean it up and improve its formatting, and is currently in the markdown directory.


Contributing

See Contributing.


Copyright and Licence

Copyright (c) 2018, The University of Edinburgh

  • Guidance (in markdown/ directory): Creative Commons Attribution 4.0 International
  • Source code: Apache License, Version 2.0, January 2004

For full details, see LICENCE.

software-deposit-guidance's People

Contributors

mikej888 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mikej888

software-deposit-guidance's Issues

Use inline footnotes in Markdown

pandoc Markdown supports inline footnotes e.g.

^[Example inline footnote with links to [Google](http://www.google.co.uk) and [EPCC](http://www.epcc.ed.ac.uk)]

One advantage of these is that footnote numbering is handled automatically.

Update Markdown documents to move all footnotes to be inline footnotes.

Implement more elegant handling of page breaks

Image width/heights, defined in CSS, and page breaks, defined in Markdown via CSS markup, are used to ensure a heading does not appear at the very bottom of a page or that half a page is empty because an image is too high for the space remaining.

Implement more elegant handling of page breaks to remove the need for using CSS markup in MarkDown.

This may require separate CSS depending on whether the HTML is to be deployed online or is being created as an intermediate step when creating PDFs.

Update font to Arial (or similar)

I'm not keen on Times New Roman as a web, or guide, font. I experimented with Arial/Helvetica in css/style.css:

@font-face
{
    font-family: Arial, Helvetica, sans-serif;
}

The changes were visible in HTML but not PDF. Googling proved no help in providing a straightforward solution. Defining the following did work for PDFs too:

body
{
    font-family: Arial, Helvetica, sans-serif;
}

However, line spacing within paragraphs can look inconsistent depending on the presence/absence of footnotes. Experiment with CSS to get a footnote style that does not lead to inconsistent spacing between lines within the same paragraph.

Automate SVG => PNG conversion

Currently, this is a manual process, done within an SVG editor. This should be automated, the Makefile (and if applicable README.md) updated, then the PNGs removed from the repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.