how config awestruct for asciidoc

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

how config awestruct for asciidoc

kuuyee
I want use asciidoc write blog in awestruct, how config for asciidoc?
anyone can give me example config for asciidoc?

thanks!
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
You should be good to use it. Your files should have the .asciidoc extension. You'll also need to install asciidoc and pygments (both python programs / modules)

Sent from my iPhone

On May 28, 2012, at 16:06, kuuyee <[hidden email]> wrote:

> I want use asciidoc write blog in awestruct, how config for asciidoc?
> anyone can give me example config for asciidoc?
>
> thanks!
>
> --
> View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22.html
> Sent from the Awestruct Talk mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Archives: http://talk-archive.awestruct.org/
> To unsubscribe, e-mail: [hidden email]
>

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
Hi,Jason Porter

Python, asciidoc and pygments is work in my pc, I add a article.asciidoc file :
---
layout: base
---

The Article Title
=================
Author's Name <authors@email.address>
v1.0, 2003-12

This is the optional preamble (an untitled section body). Useful for
writing simple sectionless documents consisting only of a preamble.

NOTE: The abstract, preface, appendix, bibliography, glossary and
index section titles are significant ('specialsections').


:numbered!:
[abstract]
Example Abstract
----------------
The optional abstract (one or more paragraphs) goes here.

This document is an AsciiDoc article skeleton containing briefly
annotated element placeholders plus a couple of example index entries
and footnotes.

:numbered:

The First Section
-----------------
Article sections start at level 1 and can be nested up to four levels
deep.
footnote:[An example footnote.]
indexterm:[Example index entry]

And now for something completely different: ((monkeys)), lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.

run command "awestruct -d",but generate article.html content is empty.

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

Lance Ball
Can you send or gist the terminal output from `awestruct -d`?

On May 29, 2012, at 1:41 AM, kuuyee wrote:

> Hi,Jason Porter
>
> Python, asciidoc and pygments is work in my pc, I add a article.asciidoc
> file :
>
>
> run command "awestruct -d",but generate article.html content is empty.
>
> http://talk-archive.awestruct.org/file/n24/asciidoc.jpg 
>
> --
> View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p24.html
> Sent from the Awestruct Talk mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Archives: http://talk-archive.awestruct.org/
> To unsubscribe, e-mail: [hidden email]
>


---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
this terminal output from `awestruct -d`


this my project code:
kuuyee.github.com.zip

by the way, i modify the awestruct file :
D:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\awestruct-0.2.18\lib\awestruct\asciidocable.rb

change
execute("asciidoc -s -b html5 -a pygments -a icons -a iconsdir='#{iconsdir}' -a imagesdir='#{imagesdir}' #{confopt} -o - -", content)

to
execute("python D:\dev\asciidoc-8.6.7\asciidoc.py -s -b html5 -a pygments -a icons -a iconsdir='#{iconsdir}' -a imagesdir='#{imagesdir}' #{confopt} -o - -", content)
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

mojavelinux
You may be hitting the exception swallowing code in awestruct rendering. See https://github.com/awestruct/awestruct/issues/103

That should allow you to see the error.

My guess is that something is not on your path and the command is dying. Can you verify you can run the asciidoc command by itself on the article and produce output (you may need to remove the awestruct prolog at the top of the file before running it).

-Dan

On Tue, May 29, 2012 at 11:46 PM, kuuyee <[hidden email]> wrote:
this terminal output from `awestruct -d`
http://talk-archive.awestruct.org/file/n29/asciidoc01.jpg

this my project code:
http://talk-archive.awestruct.org/file/n29/kuuyee.github.com.zip
kuuyee.github.com.zip

by the way, i modify the awestruct file :
D:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\awestruct-0.2.18\lib\awestruct\asciidocable.rb

change
execute("asciidoc -s -b html5 -a pygments -a icons -a iconsdir='#{iconsdir}'
-a imagesdir='#{imagesdir}' #{confopt} -o - -", content)

to
execute("python D:\dev\asciidoc-8.6.7\asciidoc.py -s -b html5 -a pygments -a
icons -a iconsdir='#{iconsdir}' -a imagesdir='#{imagesdir}' #{confopt} -o -
-", content)

--
View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p29.html
Sent from the Awestruct Talk mailing list archive at Nabble.com.

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597


Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

mojavelinux
Aha. I ran the asciidoc command from awestruct on your file and it died with this message:

sh: /tmp/images/smallnew.png: No such file or directory
asciidoc: WARNING: article.asciidoc: line 42: {sys3:"/usr/bin/python" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "/tmp/images/smallnew.png"}: non-zero exit status
sh: /tmp/images/tiger.png: No such file or directory
asciidoc: WARNING: article.asciidoc: line 45: {sys:"/usr/bin/python" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "/tmp/images/tiger.png"}: non-zero exit status

You have image references to images that are not available in the images/ directory of your site. If you have missing images, apparently asciidoc dies.

I would start by removing the images from the asciidoc article and getting that much working first.

-Dan

On Wed, May 30, 2012 at 4:32 AM, Dan Allen <[hidden email]> wrote:
You may be hitting the exception swallowing code in awestruct rendering. See https://github.com/awestruct/awestruct/issues/103

That should allow you to see the error.

My guess is that something is not on your path and the command is dying. Can you verify you can run the asciidoc command by itself on the article and produce output (you may need to remove the awestruct prolog at the top of the file before running it).

-Dan


On Tue, May 29, 2012 at 11:46 PM, kuuyee <[hidden email]> wrote:
this terminal output from `awestruct -d`
http://talk-archive.awestruct.org/file/n29/asciidoc01.jpg

this my project code:
http://talk-archive.awestruct.org/file/n29/kuuyee.github.com.zip
kuuyee.github.com.zip

by the way, i modify the awestruct file :
D:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\awestruct-0.2.18\lib\awestruct\asciidocable.rb

change
execute("asciidoc -s -b html5 -a pygments -a icons -a iconsdir='#{iconsdir}'
-a imagesdir='#{imagesdir}' #{confopt} -o - -", content)

to
execute("python D:\dev\asciidoc-8.6.7\asciidoc.py -s -b html5 -a pygments -a
icons -a iconsdir='#{iconsdir}' -a imagesdir='#{imagesdir}' #{confopt} -o -
-", content)

--
View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p29.html
Sent from the Awestruct Talk mailing list archive at Nabble.com.

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597





--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597


Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
This post was updated on .
Hi Dan Allen

I have update awestruct version to 0.4.7, and install asciidoc8.6.8.

but can't generate asciidoc file! Why?




and copy asciidoc config file


cp /usr/local/etc/asciidoc/html5.conf $Home/awestruct-sample/_config/


my article.asciidoc
---
layout: base 
title: asciidoc8.6.8Test
index: 102
---


This is the optional preamble (an untitled section body). Useful for
writing simple sectionless documents consisting only of a preamble.

NOTE: The abstract, preface, appendix, bibliography, glossary and
index section titles are significant ('specialsections').




and build





but generate article.html content is empty.
















Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
output:
/usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/handlers/interpolation_handler.rb:35: Use RbConfig instead of obsolete and deprecated Config.

this is a error??
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
Kuuyee, it's a bug. In the AsciidocHandler the command is created using an array which then combines all the parts into a string (the join(' ') part). That string is then passed to Shellwords in the execute_shell method (I think, don't have it in front of me, just going from memory) which essentially turns it into one big command. The execute_shell swallows the exception as well, which doesn't help at all.

The good news is that asciidoctor is very close to being able to render the majority of asciidoc (it's a clean room ruby implementation). We're hoping that will be done soon and we'll use that in awestruct.

Creating an issue would be good so we can all track it (I should have done so a while ago, my bad).

On Dec 16, 2012, at 23:13, kuuyee <[hidden email]> wrote:

> output:
>
>
> *this is a error??*
>
>
>
> --
> View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p77.html
> Sent from the Awestruct Talk mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Archives: http://talk-archive.awestruct.org/
> To unsubscribe, e-mail: [hidden email]
>

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
Hi,Jason Porter

Thanks for you replay!

awestruct next version will use asciidoctor?
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
That's what we're hoping.

Sent from my iPhone

On Dec 17, 2012, at 1:11, kuuyee <[hidden email]> wrote:

> Hi,Jason Porter
>
> Thanks for you replay!
>
> *awestruct next version will use asciidoctor?*
>
>
>
> --
> View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p79.html
> Sent from the Awestruct Talk mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Archives: http://talk-archive.awestruct.org/
> To unsubscribe, e-mail: [hidden email]
>

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
Hi, Jason Porter!

I have updte awestruct to version 0.4.8, but asciidoc is not work!

here is "awestruct -d" output

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
What is the content of the page you're trying to render, ruby version and site.yml?

Sent from my iPhone

On Jan 9, 2013, at 23:56, kuuyee <[hidden email]> wrote:

> Hi, Jason Porter!
>
> I have updte awestruct to version 0.4.8, but asciidoc is not work!
>
> here is "awestruct -d" output
>
> <http://talk-archive.awestruct.org/file/n99/awestruct004.png>
>
>
>
> --
> View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p99.html
> Sent from the Awestruct Talk mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Archives: http://talk-archive.awestruct.org/
> To unsubscribe, e-mail: [hidden email]
>

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
my asciidoc page:



site.yaml



my ruby version:


asciidoc version:


here is my project soruce:
awestruct-sample.tar
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
Add this to site.yml:

asciidoc:
  engine: asciidoctor


On Thu, Jan 10, 2013 at 2:06 AM, kuuyee <[hidden email]> wrote:
my asciidoc page:

<http://talk-archive.awestruct.org/file/n101/awestruct005.png>

site.yaml

<http://talk-archive.awestruct.org/file/n101/awestruct006.png>

my ruby version:
<http://talk-archive.awestruct.org/file/n101/awestruct007.png>

asciidoc version:
<http://talk-archive.awestruct.org/file/n101/awestruct008.png>

here is my project soruce:
awestruct-sample.tar
<http://talk-archive.awestruct.org/file/n101/awestruct-sample.tar>



--
View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p101.html
Sent from the Awestruct Talk mailing list archive at Nabble.com.

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
This post was updated on .
Hi,Jason!

Thanks For Your Helping, and it looks not support chinese character code.

this my asciidoc file:


this my site.yml


and "awestruct -d " output:
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
What's the problem, that will work. Are you receiving an error when you generate the site?


On Thu, Jan 10, 2013 at 6:11 PM, kuuyee <[hidden email]> wrote:
Hi,Jason!

Thanks For Your Helping, and it looks not support chinese character code.

this my asciidoc file:
<http://talk-archive.awestruct.org/file/n103/awestruct009.png>

this my site.yml
<http://talk-archive.awestruct.org/file/n103/awestruct010.png>



--
View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p103.html
Sent from the Awestruct Talk mailing list archive at Nabble.com.

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

kuuyee
yes, I receiving an error:

----

[root@localhost kuuyee.org]# awestruct -d
Using profile: development
Generating site: http://localhost:4242
Generating: /1003/kuuyee.org/_site/article.html
Failed to render /article.html
/usr/local/share/gems/gems/haml-3.1.7/lib/haml/helpers.rb:111:in `gsub'
/usr/local/share/gems/gems/haml-3.1.7/lib/haml/helpers.rb:111:in `find_and_preserve'
/usr/local/share/gems/gems/haml-3.1.7/lib/haml/buffer.rb:148:in `format_script_true_false_false_false_false_true_false'
/1003/kuuyee.org/_layouts/base.html.haml:23:in `block in render'
/usr/local/share/gems/gems/haml-3.1.7/lib/haml/engine.rb:191:in `eval'
/usr/local/share/gems/gems/haml-3.1.7/lib/haml/engine.rb:191:in `render'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/haml_handler.rb:49:in `rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/layout_handler.rb:48:in `rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/page.rb:133:in `rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/layout_handler.rb:54:in `block in rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/layout_handler.rb:42:in `call'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/layout_handler.rb:42:in `for_layout_chain'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/handlers/layout_handler.rb:51:in `rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/page.rb:133:in `rendered_content'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/engine.rb:230:in `generate_page'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/engine.rb:218:in `block in generate_output'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/engine.rb:215:in `each'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/engine.rb:215:in `generate_output'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/engine.rb:59:in `run'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/cli/generate.rb:19:in `run'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/cli/invoker.rb:97:in `invoke_generate'
/usr/local/share/gems/gems/awestruct-0.4.8/lib/awestruct/cli/invoker.rb:41:in `invoke!'
/usr/local/share/gems/gems/awestruct-0.4.8/bin/awestruct:9:in `<top (required)>'
/usr/local/bin/awestruct:23:in `load'
/usr/local/bin/awestruct:23:in `<main>'
>> Thin web server (v1.4.1 codename Chromeo)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4242, CTRL+C to stop

----


this is my source code
kuuyee.org.tar.gz
Reply | Threaded
Open this post in threaded view
|

Re: how config awestruct for asciidoc

LightGuard
Administrator
In reply to this post by LightGuard
Kuuyee, this works fine on my Fedora 17 system running Ruby 1.9.3, awestruct 0.4.8 and asciidoctor 0.8.0. As I don't a different system setup to try this I'm not sure what's going on. You could simply not use asciidoctor and use one of the other markup languages.


On Thu, Jan 10, 2013 at 6:24 PM, Jason Porter <[hidden email]> wrote:
What's the problem, that will work. Are you receiving an error when you generate the site?


On Thu, Jan 10, 2013 at 6:11 PM, kuuyee <[hidden email]> wrote:
Hi,Jason!

Thanks For Your Helping, and it looks not support chinese character code.

this my asciidoc file:
<http://talk-archive.awestruct.org/file/n103/awestruct009.png>

this my site.yml
<http://talk-archive.awestruct.org/file/n103/awestruct010.png>



--
View this message in context: http://talk-archive.awestruct.org/how-config-awestruct-for-asciidoc-tp22p103.html
Sent from the Awestruct Talk mailing list archive at Nabble.com.

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu



--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
12