Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(JATSParser): detect package import statements #52

Open
nokome opened this issue Nov 1, 2018 · 2 comments
Open

feat(JATSParser): detect package import statements #52

nokome opened this issue Nov 1, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@nokome
Copy link
Member

nokome commented Nov 1, 2018

Look for .xml files with <!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) ... elements and detect any package import statements (e.g. Python import, R library, or Node.js require) in any elements matching:

  • code[specific-use=cell] > named-content > alternatives > code
  • fig[fig-type=repro-fig] > alternatives > code
@nokome nokome added the enhancement New feature or request label Nov 1, 2018
@nokome nokome added this to the 1.0.0 milestone Nov 1, 2018
@nokome nokome self-assigned this Nov 1, 2018
@nokome
Copy link
Member Author

nokome commented Nov 1, 2018

Hah, literally 20 minutes after writing this down discovered this is very similar to what @nuest is doing in https://github.com/jupyter/repo2docker/pull/457/files#diff-6e857ca58d9ac7b40e175db43c40c5d0R287 to detect which Stencila execution contexts to install in repo2docker (although he how out that you only need to look for code specific-use="source")

@nokome nokome modified the milestones: 1.0.0, 1.1.0 Nov 1, 2018
@nuest
Copy link

nuest commented Nov 6, 2018

Good find - and your DOCTYPE check is not a bad idea, just to make sure! In our search we simply look for a manifest.xml file and then take the name of the JATS file from it.

@nokome nokome removed this from the 1.1 milestone Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants