|
Hi all,
is it possible (or are there plans) to generate a dependency list, e.g. for all the files that are included in an asciidoctor document. This would be similar to the clang / gcc feature gcc -MM -MG abc.cc It would be helpfull to write makefiles for generating the docs. -- Wilhelm |
|
Administrator
|
I have good news for you! This is already captured as it's needed for the inter-document cross reference feature. You can get the table from the document.references map. [source,asciidoc] ---- require 'pp' require 'asciidoctor' doc = Asciidoctor.load_file 'sample.adoc', safe: :safe pp doc.references ---- There's some other stuff in there you might be interested in as well. -Dan On Thu, Oct 2, 2014 at 6:55 AM, wimalopaan [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi all, Dan Allen | http://google.com/profiles/dan.j.allen |
|
Administrator
|
In reply to this post by wimalopaan
On Wed, Oct 8, 2014 at 2:21 AM, Dan Allen <[hidden email]> wrote:
Wow, I'm writing too much AsciiDoc lately. That should be "source,ruby". |
|
Ok, thank you very much!
|
|
In reply to this post by mojavelinux
Hi Dan,
I tried to generate dependency info, but there is a problem. Following is a test-file:
= Test
Wilhelm Meier <wilhelm.meier@hs-kl.de>
$Id: ppcSlide.adoc 868 2015-01-29 13:27:00Z wimalopaan $
:title: Test
:lang: de
:toc:
:toc-title: Inhalt
:toclevels: 4
:numbered:
:src_numbered:
:icons: font
:sectanchors:
:sectlinks:
:experimental:
:duration: 90
:source-highlighter: coderay
:coderay-css: style
:status:
:menu:
:navigation:
:split:
:goto:
:blank:
:deckjs_theme: swiss
:showtitle:
:deckjs_transition: horizontal-slide
:customcss: css/deckjs.css
:srcbase: ../src
:srcdir: cpp0000
:extractordir: .extractor
== SourceCode
include::{srcbase}/{srcdir}/{extractordir}/hello2.cc.Hello[]
When I try to run your above ruby code, the included file isn't found:
34% [lmeier:/home/lmeier/Lehre/Eigene/Prog2NeuesKonzept/ppc/doc] ppc(5) ‡ ruby dep.ruby
asciidoctor: WARNING: include file has illegal reference to ancestor of jail, auto-recovering
asciidoctor: WARNING: test3.adoc: line 35: include file not found: /home/lmeier/Lehre/Eigene/Prog2NeuesKonzept/ppc/doc/src/cpp0000/.extractor/hello2.cc.Hello
{:ids=>{"_sourcecode"=>"SourceCode"},
:footnotes=>[],
:links=>[],
:images=>[],
:indexterms=>[],
:includes=>#<Set: {}>}
*But*, renedring is ok: ⌁34% [lmeier:/home/lmeier/Lehre/Eigene/Prog2NeuesKonzept/ppc/doc] ppc(5) ‡ make test3.html asciidoctor -I ~/asciidoctor/extensions/lib -r view-result-postprocessor -r man-inline-macro -r asciidoctor-diagram -a data-uri -a single -o test3.html test3.adoc ⌁34% [lmeier:/home/lmeier/Lehre/Eigene/Prog2NeuesKonzept/ppc/doc] ppc(5) ‡ Any hints? -- Wilhelm |
|
Administrator
|
On Wed, Mar 18, 2015 at 9:55 AM, wimalopaan [via Asciidoctor :: Discussion] <[hidden email]> wrote: :srcbase: ../src Because of this line, you need to use unsafe instead of safe mode. Thus, the code would be: [source,ruby] ---- require 'pp' require 'asciidoctor' doc = Asciidoctor.load_file 'sample.adoc', safe: :unsafe pp doc.references ---- I hope that helps. |
|
Am 01.04.2015 um 19:08 schrieb mojavelinux [via Asciidoctor :: Discussion]:
> > On Wed, Mar 18, 2015 at 9:55 AM, wimalopaan [via Asciidoctor :: > Discussion] <[hidden email] > </user/SendEmail.jtp?type=node&node=2915&i=0>> wrote: > > :srcbase: ../src > > > Because of this line, you need to use unsafe instead of safe mode. Thus, > the code would be: > > [source,ruby] > ---- > require 'pp' > require 'asciidoctor' > > doc = Asciidoctor.load_file 'sample.adoc', safe: :unsafe > pp doc.references > ---- > > I hope that helps. Yes, it works! > > -Dan > > > -- > Dan Allen | http://google.com/profiles/dan.j.allen > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://discuss.asciidoctor.org/Generating-dependency-from-adoc-file-tp2306p2915.html > > To start a new topic under Asciidoctor :: Discussion, email > [hidden email] > To unsubscribe from Asciidoctor :: Discussion, click here > < > NAML > <http://discuss.asciidoctor.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- Wilhelm |
| Free forum by Nabble | Edit this page |
