Guard + LiveReload + CSS

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

Guard + LiveReload + CSS

ch007m
Hi,

When w use Guard + livereload (http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/), the HTML generated contains a reference to a css file but this file is not created by the tool and is not available in the local folder

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="Asciidoctor 0.1.4">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Untitled</title>
<link rel="stylesheet" href="./asciidoctor.css">
</head>

Is it possible that guard + asciidoctor generate it ? Is there a by default css file available from Git Repo ...?

Regards,

Charles
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard
Reply | Threaded
Open this post in threaded view
|

Re: Guard + LiveReload + CSS

snowolfe
I think you should be able to add the linkcss option to solve your problem:

guard 'shell' do
  watch(/^mydoc\.adoc$/) {|m|
    Asciidoctor.render_file(m[0], {:in_place => true, :linkcss => true})
  }
end

NOTE: I haven't tried this and I am not 100% on the syntax - educated guess :)
Reply | Threaded
Open this post in threaded view
|

Re: Guard + LiveReload + CSS

ch007m
Been able to solve my issue after adding these properties to my xxx.adoc page

:stylesdir: ./styles
:stylesheet: styles.css
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard
Reply | Threaded
Open this post in threaded view
|

Re: Guard + LiveReload + CSS

mojavelinux
Administrator
Charles,

If you are using the default stylesheet, you shouldn't need to set the stylesdir or stylesheet. You do, however, need to set the safe mode so that the copy feature is activated.

```ruby
guard 'shell' do 
  watch(/^mydoc\.adoc$/) {|m| 
    Asciidoctor.render_file m[0], :in_place => true, :safe => :unsafe, :attributes => 'linkcss'
  } 
end
```

As I mentioned in another thread, we're going to make sure to draw plenty of attention to the importance of setting the safe option.

 -Dan


On Thu, Oct 3, 2013 at 11:08 AM, ch007m [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Been able to solve my issue after adding these properties to my xxx.adoc page

:stylesdir: ./styles
:stylesheet: styles.css


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Guard-LiveReload-CSS-tp676p686.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: Guard + LiveReload + CSS

mojavelinux
Administrator
In reply to this post by ch007m
Regarding your question about where the default stylesheet comes from, it's stored internally in a string an gets written to a file when the linkcss attribute is set.

There are also a number of stylesheets you can snag from the Asciidoctor stylesheet factory.


We plan to bundle up these themes so that you can consume them in the same way as the default stylesheet, but that's roadmap material :)

-Dan


On Fri, Oct 4, 2013 at 4:29 AM, Dan Allen <[hidden email]> wrote:
Charles,

If you are using the default stylesheet, you shouldn't need to set the stylesdir or stylesheet. You do, however, need to set the safe mode so that the copy feature is activated.

```ruby
guard 'shell' do 
  watch(/^mydoc\.adoc$/) {|m| 
    Asciidoctor.render_file m[0], :in_place => true, :safe => :unsafe, :attributes => 'linkcss'
  } 
end
```

As I mentioned in another thread, we're going to make sure to draw plenty of attention to the importance of setting the safe option.

 -Dan


On Thu, Oct 3, 2013 at 11:08 AM, ch007m [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Been able to solve my issue after adding these properties to my xxx.adoc page

:stylesdir: ./styles
:stylesheet: styles.css


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Guard-LiveReload-CSS-tp676p686.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



--