Git Product home page Git Product logo

org-asciidoc's Introduction

https://melpa.org/packages/ox-asciidoc-badge.svg https://github.com/yashi/org-asciidoc/actions/workflows/tests.yml/badge.svg

org-asciidoc

An Org Mode Exporter Backend For AsciiDoc and Asciidoctor

Setup

  1. Make sure you have org-mode v8.0 or later
  2. Clone this repository
  3. Add the following to your .emacs
    (add-to-list 'load-path "~/path/to/org-asciidoc/")
    (require 'ox-asciidoc)
        
  4. open a .org file and run org-asciidoc-export-as-asciidoc

AsciiDoc specific attributes

AsciiDoc backend understands the following attributes in a ATTR_ASCIIDOC line.

Source Code Blocks

:asciidoctor-diagram
Export a source code block as an Asciidoctor Diagram. Set it as t to generate a listing block for an asciidoctor diagram.

Make sure to set :exports to something non-standard, diagram. This allows us to get :file parameter in the exporter.

e.g)

#+ATTR_ASCIIDOC: :asciidoctor-diagram t
#+BEGIN_SRC ditaa :file images/hello-world.png :exports diagram
+--------------+
| Hello World! |
+--------------+
#+END_SRC
    

Tables

:width
a percentage value to specify the table width with in the current column. Valid values: 1โ€ฆ99.

e.g)

#+ATTR_ASCIIDOC: :width 50
| Name  | Phone | Age |
| Peter |  1234 |  17 |
| Anna  |  4321 |  25 |
    
:pgwide
a boolean value to specify the table should be column width or full page width in multi-column setup. Valid values: t or nil.

e.g)

#+ATTR_ASCIIDOC: :pgwide t
| Name  | Phone | Age |
| Peter |  1234 |  17 |
| Anna  |  4321 |  25 |
    

org-publish

If you want to use `org-publish` with ox-asciidoc, setup your `org-publish-project-alist` like this:

 (setq org-publish-project-alist
	  '(("my-proj"
	     :base-directory "/tmp/my-dir"
	     :publishing-directory "/tmp/pub-dir"
	     :publishing-function org-asciidoc-publish-to-asciidoc)))

org-asciidoc's People

Contributors

yashi avatar yasuyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

org-asciidoc's Issues

Specifying relative width of columns in a table

I haven't been able to figure out how to specify the relative width of the columns in a org-mode table. Below is an idea of what I would like the asciidoc output to be, and I don't know how to achieve it.

[cols="1,1,3", options="header"]
|===
|Version
|Date
|Comment

|0.1
|2016-03-16
|Revisions after feedback from users.

Image support?

First of all, thanks for this very gorgeous package, it really takes my ebook publishing workflow to the next level.

One thing that I might be missing (asciidoc beginner here!) is image support.

I guess the gist of the problem is that in org-mode an image is only

a link to an image file

(https://orgmode.org/manual/Images.html)

It does seem like it should be possible to filter out image links by looking at "image-file-name-extensions and image-file-name-regexps" (ibid.). Do you think it'd be possible to implement this?

Literal blocks don't seem to be exported correctly...

If I have a file with this in it:

: Test

The result is this:

: Test

I would expect to see something like this:

....
Test
....

I run into this a lot when executing source blocks where the result is output as:

#+RESULTS:
: Test

Convert example block and fixed-width to the AsciiDoc's Literal Blocks instead of thje Listing Blocks

Asciidoc differentiates Listing Blocks (----) and Literal Blocks (....), however the current ox-asciidoc converts all three elements (src block, example block, fixed width) to the Listing Block. It'd be better to converts example blocks and fixed widths to the Literal Blocks (....), but keep src blocks to the Listing Blocks (----).

ox-html converts all three to pre, but classifies example blocks and colons to example, src blocks to src

Add melpa banner for this project.

I just think this might look nice.

MELPA

Just copypasta this into readme.org.

[[https://melpa.org/#/ox-asciidoc][file:https://melpa.org/packages/ox-asciidoc-badge.svg]]

Support #+CAPTION: headers for source/example blocks.

It would be nice if this:

#+CAPTION: My Sidebar
#+BEGIN_EXAMPLE
This is a sidebar.
#+END_EXAMPLE

Produced this:

.My Sidebar
****
This is a sidebar.
****

I think the difficult part is determining when an example block should be a literal block (....) or a sidebar. I guess if it's an example block AND it has a caption, it should be turned into a sidebar?

Support Asciidoctor extensions

Hi! I just discovered this ORG exporter and I realized that not everything is exported properly into proper asciidoctor syntax.

Especially literals seem not to be exported properly. For example I'd like to have the ORG mode equivalent of this asciidoctor literal

[chart,pie,order=null,legend=right]
....
Code Review,27
Unit Testing,19
Functional Testing,13
Continuous Integration,12
Integration Testing,9
Detailed Requirements,7
Static Analysis,3
Training/On-boarding,3
User Stories,2
Other,5
....

Another one:

[plantuml, rma-sequence-diagram, svg]
....
participant User
User -> A: DoWork
activate A
A -> B: << createRequest >>
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: RequestCreated
deactivate B
A -> User: Done
deactivate A
....

Is this supported at all? And if yes, what would be the ORG equivalent to the literals above?

Thanks in advance.

Definition lists don't render correctly

Runtime Environment

  • MX Linux 17
  • GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
    of 2018-11-28
  • Evil version 1.2.13
  • Org mode version 9.1.9
  • .emacs.d
  • packages
  • ox-asciidoc-20171111.1154

Issue

The following Org syntax (as in the documentation):

- Name :: definition

Gives the following results on the exported file:

nil definition

When it should be:

Name :: definition

I'm using org-export-dispatch.

Emphasis is not translated correctly

Runtime Environment

  • MX Linux 17
  • GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
    of 2018-11-28
  • Evil version 1.2.13
  • Org mode version 9.1.9
  • .emacs.d
  • packages
  • ox-asciidoc-20171111.1154

Issue

The following Org syntax:

/Some Empahized Text/

Is not exported as emphasis. It does this instead:

'Some Empahized Text'

When it should be:

_Some Empahized Text_

I'm using org-export-dispatch.

Paragraphs under lists are not joined by list-continuations.

See: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#lists

* Every list item has at least one paragraph of content,
  which may be wrapped, even using a hanging indent.
+
Additional paragraphs or blocks are adjoined by putting
a list continuation on a line adjacent to both blocks.
+
list continuation:: a plus sign (`{plus}`) on a line by itself

* A literal paragraph does not require a list continuation.

 $ gem install asciidoctor

* AsciiDoc lists may contain any complex content.
+
[cols="2", options="header"]
|===
|Application
|Language

|AsciiDoc
|Python

|Asciidoctor
|Ruby
|===

In org, if I have this:

Continuation list:
1. Item 1
   With adjoining paragraph.
2. Item 2
   Also with adjoining paragraph.
3. Item 3
   Yep. Another adjoining paragraph.

I get this:

Continuation list:

. Item 1
With adjoining paragraph.
. Item 2
Also with adjoining paragraph.
. Item 3
Yep. Another adjoining paragraph.

And I would expect this:

Continuation list:

. Item 1
+
With adjoining paragraph.

. Item 2
+
Also with adjoining paragraph.

. Item 3
+
Yep. Another adjoining paragraph.

Footnotes don't seem to be supported.

I think this is more of a question. If I use footnotes as described here, and have the following:

* My Text
  This sentence needs a footnote[fn:1].

* Footnotes
  [fn:1] http://www.google.com

How should that be translated into ASCIIdoc? This seems to suggest it should produce the following:

== My Text ==
This sentence needs a footnote footnoteref:[1]

== Footnotes ==
footnoteref:[1,http://www.google.com]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.