document-composer

Document Composer

https://github.com/dnoliver/document-composer

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (0.2%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Document Composer

Basic Info
  • Host: GitHub
  • Owner: dnoliver
  • Language: JavaScript
  • Default Branch: main
  • Size: 50.8 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 5 years ago · Last pushed over 4 years ago
Metadata Files
Readme Citation

README.md

Document Composer

Compose a World Document from a bunch of Markdown files

Owner

  • Name: Nicolas Oliver
  • Login: dnoliver
  • Kind: user
  • Location: Hillsboro, Oregon
  • Company: Intel Corporation

Citation (citations.js)

let str = ''

process.stdin
  .on('data', data => {
    str += data.toString()
  })
  .on('end', () => {
    // Select all links that have url targets
    const matches = str.match(/\[([^[\]]+)\]\(http([^)]+)\)/gm)

    if (matches) {
      const citationsCollection = []
      let citationIndex = 1

      for (const i in matches) {
        const match = matches[i]
        const parts = match.match(/\[([^[\]]+)\]\((http[^)]+)\)/)
        if (parts) {
          const citationObject = {
            name: parts[1],
            link: parts[2]
          }
          const oldCitation = citationsCollection.find(x => x.link === citationObject.link)
          if (typeof oldCitation === 'undefined') {
            citationObject.index = citationIndex
            citationsCollection.push(citationObject)
            str = str.replace(match, `${match} [[${citationObject.index}]](#citations)`)
            citationIndex = citationIndex + 1
          } else {
            str = str.replace(match, `${match} [[${oldCitation.index}]](#citations)`)
          }
        }
      }

      let citations = '# Citations\n\n'
      citationsCollection.forEach(function (o) {
        citations += `* [${o.index}] "${o.name}": [${o.link}](${o.link})\n`
      })

      console.log(str)
      console.log(citations)
    } else {
      // No Citations
      console.log(str)
    }
  })

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels