Socket
Socket
Sign inDemoInstall

@antora/asciidoc-loader

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/asciidoc-loader - npm Package Compare versions

Comparing version 1.0.0-beta.3 to 1.0.0-rc.1

34

lib/load-asciidoc.js

@@ -55,8 +55,9 @@ 'use strict'

}
const fileSrc = file.src
const intrinsicAttrs = {
docname: file.src.stem,
docname: fileSrc.stem,
docfile: file.path,
// NOTE docdir implicitly sets base_dir on document; Opal only expands value to absolute path if it starts with ./
docdir: file.dirname,
docfilesuffix: file.src.extname,
docfilesuffix: fileSrc.extname,
imagesdir: path.join(file.pub.moduleRootPath, '_images'),

@@ -67,3 +68,4 @@ attachmentsdir: path.join(file.pub.moduleRootPath, '_attachments'),

}
const attributes = Object.assign({}, envAttrs, defaultAttrs, config.attributes, intrinsicAttrs)
const pageAttrs = fileSrc.family === 'page' ? computePageAttrs(fileSrc, contentCatalog) : {}
const attributes = Object.assign({}, envAttrs, defaultAttrs, config.attributes, intrinsicAttrs, pageAttrs)
const relativizePageRefs = config.relativizePageRefs !== false

@@ -88,2 +90,28 @@ const converter = createConverter(asciidoctor, {

function computePageAttrs (fileSrc, contentCatalog) {
const attrs = {}
// QUESTION should we soft set the page-id attribute?
attrs['page-component-name'] = fileSrc.component
attrs['page-component-version'] = fileSrc.version
const component = contentCatalog && contentCatalog.getComponent(fileSrc.component)
if (component) attrs['page-component-title'] = component.title
attrs['page-module'] = fileSrc.module
attrs['page-relative'] = fileSrc.relative
const origin = fileSrc.origin
if (origin) {
attrs['page-origin-type'] = origin.type
attrs['page-origin-url'] = origin.url
attrs['page-origin-start-path'] = origin.startPath
if (origin.branch) {
attrs['page-origin-refname'] = attrs['page-origin-branch'] = origin.branch
attrs['page-origin-reftype'] = 'branch'
} else if (origin.tag) {
attrs['page-origin-refname'] = attrs['page-origin-tag'] = origin.tag
attrs['page-origin-reftype'] = 'tag'
}
if (origin.worktree) attrs['page-origin-worktree'] = ''
}
return attrs
}
/**

@@ -90,0 +118,0 @@ * Resolves a global AsciiDoc configuration object from data in the playbook.

2

package.json
{
"name": "@antora/asciidoc-loader",
"version": "1.0.0-beta.3",
"version": "1.0.0-rc.1",
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.",

@@ -5,0 +5,0 @@ "license": "MPL-2.0",

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