:scroll: A JavaScript port of Asciidoctor, a modern implementation of AsciiDoc
This release is based on Asciidoctor 2.0.15 and Opal 0.11.99.dev (31d26d69).
It includes all the fixes from Asciidoctor 2.0.15 without any additional changes in Asciidoctor.js.
Released on: 2021-04-30 Released by: @Mogztter Published by: GitHub Actions
Logs: full diff
:book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.13 and Opal 0.11.99.dev (31d26d69).
It includes all the fixes from Asciidoctor 2.0.13 without any additional changes in Asciidoctor.js.
Released on: 2021-04-13 Released by: @Mogztter Published by: GitHub Actions
Logs: full diff
:book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.12 and Opal 0.11.99.dev (31d26d69).
Released on: 2021-03-24 Released by: @Mogztter Published by: GitHub Actions
Logs: full diff
AbstractNode#getImageUri
, #getMediaUri
, #getIconUri
(#1193)Document#getDocumentTitle
, #getTitle
(can return undefined) (#1150)AbstractNode#getParent
(can return undefined) (#1131)AbstractBlock#alt
(and Inline#alt
) (#1192)AbstractNode#resolveSubstitutions
returns undefined
(#1153)file:///
:book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.12 and Opal 0.11.99.dev (31d26d69).
This version includes all the bug fixes and improvements introduced in Asciidoctor Ruby 2.0.11 and 2.0.12 :tada: It also contains a few bug fixes and improvements related to the Asciidoctor.js API.
Released on: 2020-11-26 Released by: @Mogztter Published by: GitHub Actions
Logs: full diff
Opal.nil
when title is undefined (#1010)AbstractBlock#assignCaption
(#1011)const doc = asciidoctor.load('= Title')
const image = asciidoctor.Block.create(doc, 'image', {
content_model: 'empty',
attributes: {
target: `${testOptions.baseDir}/spec/fixtures/images/cat.png[]`,
format: 'png'
}
})
image.setTitle('A cat')
image.assignCaption('Figure I. ')
console.log(image.getCaptionedTitle()) // Figure I. A nice cat'
const doc = asciidoctor.load('[positional1,positional2,attr=value]\ntext')
const block = doc.getBlocks()[0]
const attributes = block.getAttributes()
console.log(Object.getOwnPropertyNames(attributes)) // ['attr', 'style']
console.log(Object.getOwnPropertyNames(attributes)) // ['$positional', 'attr', 'style']
console.log(attributes.$positional) // ['positional1', 'positional2'])
http-server
from 0.12.1 to 0.12.3 in /packages/core (#953)dtslint
from 3.4.2 to 3.6.3 in /packages/core (#958) (#971) (#976)puppeteer
from 3.0.1 to 3.1.0 in /packages/core (#956) (#961) (#963) (#974)@types/node
from 13.13.4 to 13.13.5 in /packages/core (#960)standard
from 14.3.3 to 14.3.4 (#966) (#965)ejs
from 3.1.2 to 3.1.3 in /packages/core (#970)typescript
(development dependency)npm audit fix
:book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.10 and Opal 0.11.99.dev (31d26d69).
The main feature highlight of the 2.2 release is the built-in template converter which supports out-of-the-box Pug, Nunjucks, EJS and Handlebars (optional dependency). The quickest way to get started is to install one of the above template engine and to define a template directory. Here's a quick example on how to setup the template converter with Nunjucks:
install
$ npm i nunjucks
/path/to/templates/paragraph.njk
<p>{{ node.getContent() | safe }}</p>
convert.js
const options = { safe: 'safe', backend: 'html5', template_dir: '/path/to/templates' }
console.log(asciidoctor.convert('...', options))
Please note that we also provide all-in-one pack binaries that include the templates engines, so it's even easier to get started:
$ echo 'Hello *world*' | ./asciidoctor-linux -s -T ./templates -
<p>Hello <strong>world</strong></p>
If you want to learn more about the template converter, please read the documentation.
Released on: 2020-04-28 Released by: @Mogztter Published by: GitHub Actions
Logs: full diff
asciidoctor
command line installed from the package asciidoctor
was throwing an exception (#849) - thanks @thorstenkampeAbstractNode.hasSection
now returns false for anything that isn’t itself a Section
(#840) - thanks @henriette-einsteinConverter.handles?
method (#906)Converter.respond_to?
method (#908)Converter.composed
method (#907)AbstractNode.getAttributes
now returns undefined when the value is Opal.nil
(#920)@asciidoctor/cli
in the asciidoctor
package to 3.4.0 (#902)const options = { safe: 'safe', backend: 'html5', template_dir: '/path/to/templates' }
console.log(asciidoctor.convert('...', options))
Document.restoreAttributes
(#843) (#851)Document.playbackAttributes
(#844) (#853)Table
, Column
and Cell
methods (#854) - many thanks to @henriette-einsteinSubstitutors.resolveSubstitutions
, .resolveBlockSubstitutions
and .resolvePassSubstitutions
(#852)class BlankConverter {
convert () {
return ''
}
}
asciidoctor.ConverterFactory.register(new BlankConverter(), ['blank'])
const registry = asciidoctor.ConverterFactory.getRegistry()
registry.blank.convert()
const builtinHtml5Converter = asciidoctor.ConverterFactory.for('html5')
builtinHtml5Converter.convert()
asciidoctor.ConverterFactory.for('foo') // undefined
asciidoctor
CLI on GitHub releases (#929)libnpmpublish
from 1.1.1 to 3.0.0 (#863)cross-env
from 5.1.4 to 6.0.3 in /packages/core (#879)dtslint
from 2.0.3 to 3.4.2 in /packages/core (#888) (#871) (#940)@types/node
from 12.7.8 to 13.13.4 in /packages/core (#889) (#874) (#866) (#932) (#934) (#938) (#947)documentation
from 12.1.3 to 12.1.4 in /packages/core (#882)sinon
from 5.0.6 to 8.1.1 (#872)puppeteer
from 1.18.0 to 3.0.1 in /packages/core (#876) (#931) (#939)eslint
from 5.12.1 to 6.8.0 in /packages/core (#877)standard
from 12.0.1 to 14.3.3 (#862)standard
from 12.0.1 to 14.3.3 in /packages/core (#870)mocha
from 6.1.4 to 7.1.2 in /packages/core (#864) (#946)mocha
from 5.1.1 to 7.1.2 (#867) (#945)chai
from 4.1.2 to 4.2.0 in /packages/core (#868)chai
from 4.1.2 to 4.2.0 (#869)acorn
from 5.7.3 to 5.7.4 in /packages/core (#860)acorn
from 6.1.1 to 6.4.1 (#859)ejs
from 3.0.1 to 3.0.2 in /packages/core (#922)pkg
from 4.4.7 to 4.4.8 in /packages/asciidoctor (#948)test:graalvm
task on macOS (#840).dts
directory to workaround an issue with npm/Travis (#842):book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.10 and Opal 0.11.99.dev (31d26d69). This release actually contains the TypeScript Declare File! It also includes a few bug fixes and improvements.
Released on: 2020-02-01 Released by: @Mogztter Published by: Travis
Logs: full diff
AbstractBlock.getCaption
(#831) - thanks @cexbrayatOpal.nil
on AbstractBlock.getCaption
(#831) - thanks @cexbrayatSyntaxHighlighter
type definition (#832)SyntaxHighlighter.for
, use SyntaxHighlighter.get
instead (#832)@asciidoctor/cli
in the asciidoctor
package to 3.2.0:book: API documentation :books: User Manual
This release is based on Asciidoctor 2.0.10 and Opal 0.11.99.dev (31d26d69). It provides a TypeScript Declaration File, maps new functions and classes in the API and improves the registration of converters :tada: In addition, it includes all the bug fixes and improvements made in Asciidoctor Ruby in 2.0.10.
Released on: 2020-01-26 Released by: @Mogztter Published by: Travis
Logs: full diff
undefined
if the style is Opal.nil
on AbstractBlock.getStyle
undefined
if the level is Opal.nil
on AbstractBlock.getLevel
Processor.resolveAttributes
can take a JSON, a boolean, a string, an array of strings or a list of strings as argument (#780)const registry = asciidoctor.Extensions.create(function () {
this.inlineMacro('deg', function () {
this.resolveAttributes('1:units', 'precision=1')
//this.resolveAttributes(['1:units', 'precision=1'])
//this.resolveAttributes({ '1:units': undefined, 'precision': 1 })
this.process(function (parent, target, attributes) {
// ...
})
})
})
undefined
if the reftext is Opal.nil
on an AbstractNode.getReftext
applySubstitutions
to AbstractNode
instead of AbstractBlock
(#793)counterIncrement
, use Document.incrementAndStoreCounter
instead (#792)chrome://
as a root path in a browser environment (#816)Processor.resolvesAttributes
is deprecated (in favor of resolveAttributes
)AbstractBlock.setStyle
(#737)AbstractBlock.setTitle
(#737)AbstractBlock.getSourceLocation
(#737)Section.setLevel
(#737)SyntaxProcessorDsl.defaultAttributes
(#785)registry.inlineMacro('attrs', function () {
const self = this
self.matchFormat('short')
self.defaultAttributes({ 1: 'a', 2: 'b', 'foo': 'baz' })
self.positionalAttributes('a', 'b')
self.process((parent, target, attrs) => {
// ...
})
})
// register a converter as an ES6 class
class TEIConverter {
constructor (backend, _) {
this.backend = backend
this.backendTraits = {
basebackend: 'xml',
outfilesuffix: '.xml',
filetype: 'xml',
htmlsyntax: 'xml'
}
}
}
asciidoctor.ConverterFactory.register(TEIConverter, ['tei'])
// register a converter as an ES6 class instance
class TEIConverter {
constructor () {
this.backend = 'tei'
this.basebackend = 'xml'
this.outfilesuffix = '.xml'
this.filetype = 'xml'
this.htmlsyntax = 'xml'
}
}
asciidoctor.ConverterFactory.register(new TEIConverter(), ['tei'])
class DelegateConverter {
convert (node, transform) {
// delegate to the class methods
return this[`convert_${transform || node.node_name}`](node)
}
convert_embedded (node) {
return `<delegate>${node.getContent()}</delegate>`
}
convert_paragraph (node) {
return node.getContent()
}
}
asciidoctor.ConverterFactory.register(new DelegateConverter(), ['delegate'])
Asciidoctor.SafeMode
(#777)console.log(asciidoctor.SafeMode.UNSAFE) // 0
console.log(asciidoctor.SafeMode.SAFE) // 1
console.log(asciidoctor.SafeMode.SERVER) // 10
console.log(asciidoctor.SafeMode.SECURE) // 20
console.log(asciidoctor.SafeMode.getValueForName('secure')) // 20
console.log(asciidoctor.SafeMode.getNameForValue(0)) // 'unsafe'
console.log(asciidoctor.SafeMode.getNames()) // ['unsafe', 'safe', 'server', 'secure']
Processor.createParagraph
(#774)Processor.createOpenBlock
(#774)Processor.createExampleBlock
(#774)Processor.createPassBlock
(#774)Processor.createListingBlock
(#774)Processor.createLiteralBlock
(#774)Processor.createAnchor
(#774)Processor.createInlinePass
(#774)AbstractNode.setId
(#791)Block.create
to instantiate a new Block
object (#796)Section#create
to instantiate a new Section
object (#795)Document.incrementAndStoreCounter
(#792)Reader.advance
(#804)Document.setSourcemap
(#810)doc.setSourcemap(true)
Processor.getConfig
(#812)Processor.option
(#813)registry.inlineMacro('package', function () {
this.option('defaultPackageUrlFormat', 'https://packages.ubuntu.com/bionic/%s')
this.process(function (parent, target) {
const format = parent.getDocument().getAttribute('url-package-url-format', this.getConfig().defaultPackageUrlFormat)
return this.createInline(parent, 'anchor', target, { type: 'link', target: format.replace('%s', target), attributes: { window: '_blank' } })
})
})
Asciidoctor.Callouts
(#814)Processor.parseAttributes
(#815)@asciidoctor/cli
in the asciidoctor
package to 3.1.1 (#820)InlineProcessor.match
(#823)npm audit fix
documentation
to 12.1.3 (#762)mocha
to 6.1.4 (#739)puppeteer
to 1.18.0 (#740)sinon
to 7.3.2 (#741)eslint-utils
from 1.3.1 to 1.4.2 (#749)findBy
API (with reject) (#806)This release is based on Asciidoctor 2.0.9 and Opal 0.11.99.dev (31d26d69). It includes all the bug fixes and improvements made in Asciidoctor Ruby in 2.0.7, 2.0.8 and 2.0.9 :tada:
Released on: 2019-05-01 Released by: @Mogztter Published by: Travis
Logs: resolved issues | full diff