Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/document-converter

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/document-converter - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0-alpha.1

17

lib/convert-documents.js

@@ -16,11 +16,22 @@ 'use strict'

* @param {ContentCatalog} contentCatalog - The catalog of all virtual content files in the site.
* @param {Object} [asciidocConfig={}] - AsciiDoc processor configuration options.
* @param {Object} [siteAsciiDocConfig={}] - Site-wide AsciiDoc processor configuration options.
*
* @returns {Array<File>} The virtual files in the page family taken from the content catalog.
*/
function convertDocuments (contentCatalog, asciidocConfig = {}) {
function convertDocuments (contentCatalog, siteAsciiDocConfig = {}) {
const asciidocConfigs = new Map(
contentCatalog.getComponents().reduce((accum, { name, versions }) => {
return accum.concat(versions.map(({ version, asciidocConfig }) => [name + '@' + version, asciidocConfig]))
}, [])
)
return contentCatalog
.findBy({ family: 'page' })
.filter((page) => page.out)
.map((page) => (page.mediaType === 'text/asciidoc' ? convertDocument(page, contentCatalog, asciidocConfig) : page))
.map((page) => {
if (page.mediaType === 'text/asciidoc') {
const asciidocConfig = asciidocConfigs.get(page.src.component + '@' + page.src.version) || siteAsciiDocConfig
return convertDocument(page, contentCatalog, asciidocConfig)
}
return page
})
.map((page) => delete page.src.contents && page)

@@ -27,0 +38,0 @@ }

4

package.json
{
"name": "@antora/document-converter",
"version": "2.2.0",
"version": "2.3.0-alpha.1",
"description": "Converts AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline.",

@@ -20,3 +20,3 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/asciidoc-loader": "2.2.0"
"@antora/asciidoc-loader": "2.3.0-alpha.1"
},

@@ -23,0 +23,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc