New directive for including an entire folder

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

New directive for including an entire folder

torabisu
Hi all

Working on a project that allows content writers to create fragments in a folder, and I don't want to have to explicitly include each file, for example:

_my_content/_my_fragment_1.adoc
_my_content/_my_fragment_2.adoc
_my_content/_my_fragment_3.adoc
...

my _main_content/index.adoc looks like:

# My Main Content File

include::_my_content/_my_fragment_1.adoc
include::_my_content/_my_fragment_2.adoc
include::_my_content/_my_fragment_3.adoc
..

Instead, would want to call something like:

includes::_my_content/*.adoc

Any possible solutions?



Reply | Threaded
Open this post in threaded view
|

Re: New directive for including an entire folder

LightGuardjp
Nothing out of the box, but this could certainly be done with an extension. There are lots of examples of extension in github and also on this list. 

On Friday, September 11, 2015, torabisu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi all

Working on a project that allows content writers to create fragments in a folder, and I don't want to have to explicitly include each file, for example:

_my_content/_my_fragment_1.adoc
_my_content/_my_fragment_2.adoc
_my_content/_my_fragment_3.adoc
...

my _main_content/index.adoc looks like:

# My Main Content File

include::_my_content/_my_fragment_1.adoc
include::_my_content/_my_fragment_2.adoc
include::_my_content/_my_fragment_3.adoc
..

Instead, would want to call something like:

includes::_my_content/*.adoc

Any possible solutions?






If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/New-directive-for-including-an-entire-folder-tp3731.html
To start a new topic under Asciidoctor :: Discussion, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs49171n1h37@n6.nabble.com&#39;);" target="_blank">ml-node+s49171n1h37@...
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Sent from Gmail Mobile
Reply | Threaded
Open this post in threaded view
|

Re: New directive for including an entire folder

torabisu
I'll take a peek at the extensions, and if non exist, will create one...

Thanks for the feedback.

LightGuardjp wrote
Nothing out of the box, but this could certainly be done with an extension.
There are lots of examples of extension in github and also on this list.

On Friday, September 11, 2015, torabisu [via Asciidoctor :: Discussion] <
[hidden email]> wrote:

> Hi all
>
> Working on a project that allows content writers to create fragments in a
> folder, and I don't want to have to explicitly include each file, for
> example:
>
> _my_content/_my_fragment_1.adoc
> _my_content/_my_fragment_2.adoc
> _my_content/_my_fragment_3.adoc
> ...
>
> my _main_content/index.adoc looks like:
>
> # My Main Content File
>
> include::_my_content/_my_fragment_1.adoc
> include::_my_content/_my_fragment_2.adoc
> include::_my_content/_my_fragment_3.adoc
> ..
>
> Instead, would want to call something like:
>
> includes::_my_content/*.adoc
>
> Any possible solutions?
>
>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://discuss.asciidoctor.org/New-directive-for-including-an-entire-folder-tp3731.html
> To start a new topic under Asciidoctor :: Discussion, email
> [hidden email]
> <javascript:_e(%7B%7D,'cvml','ml-node%[hidden email]');>
> To unsubscribe from Asciidoctor :: Discussion, click here
> <http://discuss.asciidoctor.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=bGlnaHRndWFyZC5qcEBnbWFpbC5jb218MXw3NzU3OTU3MTg=>
> .
> 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>
>


--
Sent from Gmail Mobile
Reply | Threaded
Open this post in threaded view
|

Re: New directive for including an entire folder

abelsromero
Hi,

Just adding some extra info for you. Remember that you can write extension mainly in Ruby or Java.
Here you'll find some Ruby examples https://github.com/asciidoctor/asciidoctor-extensions-lab, if you want to try in Java, here is the documentation with some examples too https://github.com/asciidoctor/asciidoctorj.

I think, that in your case you should have a look at the include processor.

If you need any other help just let us know.
Reply | Threaded
Open this post in threaded view
|

Re: New directive for including an entire folder

mojavelinux
Administrator
I think this request is related to the following issue:


I definitely encourage you to pursue this as an extension, but that doesn't rule out including it in core one day :)

Cheers,

-Dan

On Fri, Sep 11, 2015 at 9:26 AM, abelsromero [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

Just adding some extra info for you. Remember that you can write extension mainly in Ruby or Java.
Here you'll find some Ruby examples https://github.com/asciidoctor/asciidoctor-extensions-lab, if you want to try in Java, here is the documentation with some examples too https://github.com/asciidoctor/asciidoctorj.

I think, that in your case you should have a look at the include processor.

If you need any other help just let us know.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/New-directive-for-including-an-entire-folder-tp3731p3734.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: New directive for including an entire folder

wolandscat
In reply to this post by torabisu
This feature did occur to me some time ago, but the difficulty is that the order in which we want the files in our directory included is not any of the general alphabet or date orders - they are class texts, whose order of preservation have their own logic.

So although I can see use for the feature, it's not a burner for us, and I suspect probably isn't for any similar software engineering style documents - e.g. where directories contain Antlr grammars or classes or API degs.

Others may have completely different use cases of course that really need this feature - but again - I'll just flag ordering as a possible fly-in-the-ointment.