css_doc: Documentation Extraction Tool written in Ruby

111 views
Skip to first unread message

tkadauke

unread,
Jul 20, 2009, 5:48:32 PM7/20/09
to CSSDOC
Hey everyone,

As there is no tool to extract documentation from CSS files that I
know of, I got my hands dirty and wrote one myself. It is written in
the Ruby language as a Rubygem, and makes use of the wonderful csspool
library, which in turn depends on Gnome's powerful libcroco to do its
parsing. Therefore, the parser is as correct and stable as any CSS
parser using these libraries.

You can find the complete source code along with installation
instructions on Github:

http://github.com/imedo/css_doc

Unfortunately, because of a bug in libcroco, installation is still a
bit awkward, since you have to manually patch a C source file to get
it to work.

Please note that the css_doc library implements only a subset of the
CSSDOC standard (yet), but also has some unique features of its own,
like code usage examples. Therefore, this tool is also very useful for
extracting a styleguide directly from your CSS files.

For an example of what documentation could look like, click here:

http://opensource.imedo.de/css_doc/index.html

Please let me know what you think about this tool, and of any ways on
how to improve it.

Thanks,
--Thomas Kadauke

mot

unread,
Jul 21, 2009, 4:40:17 AM7/21/09
to css...@googlegroups.com


Heya Thomas!

That's really great news, and it looks just great!

I started a CSSDOC Implementations page in the Wiki and linked your
project there:

http://cssdoc.net/wiki/CssdocImplementations

And put it on the front page.

I was not aware of such a library, need to take a look.

Regards,
Tom

tkadauke

unread,
Jul 21, 2009, 8:04:02 AM7/21/09
to CSSDOC
Hey tom,

On 21 Jul., 10:40, mot <artn...@googlemail.com> wrote:
> On Mon, Jul 20, 2009 at 11:48 PM, tkadauke<tkada...@imedo.de> wrote:
> Heya Thomas!
>
> That's really great news, and it looks just great!
>
> I started a CSSDOC Implementations page in the Wiki and linked your
> project there:
>
> http://cssdoc.net/wiki/CssdocImplementations
>
> And put it on the front page.
>
> I was not aware of such a library, need to take a look.

Yeah, I wasn't either before I found csspool. I was about to write my
own CSS parser, which looking at it now would have been a stupid idea.
It really made things easy. After I figured out how to fix the
libcroco bug, it took me about an hour to get a first prototype
working, and another four hours to get it where it is right now.

--Thomas

sam foster

unread,
Jul 21, 2009, 4:44:45 PM7/21/09
to css...@googlegroups.com
There are several CSS parsers around - perl has at least one, as does
java, python. But the first thing they all do is throw away comments,
so it takes hacking at the grammar to get them to be cssdoc-aware, by
which point you are more than half-way to making your own parser it
seems.

/Sam

mot

unread,
Jul 24, 2009, 6:45:45 AM7/24/09
to css...@googlegroups.com
wir können auch deutsch schreiben wie ich dann gelesen habe :D

bin nicht so in C drin aber muss mal gucken ob wir libroco nach PHP
kriegen. vielleicht geht da was. die bisherigen parser an den ich dran
bin ist mehr selbstschreiben, aber libroco hat eh einige gute ideen.

was ich mich gefragt habe ist wie das da mit den kommentaren läuft.
die habe ich nicht gefunden.

viele grüsse aus mainz

tom
Reply all
Reply to author
Forward
0 new messages