Skip to content

Commit

Permalink
autodocs - added support for generating documentation for ruby files
Browse files Browse the repository at this point in the history
using yard generator

- 2.24.3
  • Loading branch information
Ladislav Slezak committed Jul 18, 2013
1 parent 0c95a2c commit 31dd002
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.24.2
2.24.3
19 changes: 18 additions & 1 deletion devtools/admin/aminclude/autodocs-ycp.ami
Expand Up @@ -8,6 +8,8 @@
# Optional - the default is $(srcdir)/../../src/*.ycp
# AUTODOCS_PM: Files that the perl autodocs is built from
# Optional - the default is $(srcdir)/../../src/*.pm
# AUTODOCS_RB: Files that the ruby autodocs is built from (using yard)
# Optional - the default is $(srcdir)/../../src/modules/*.rb) $(srcdir)/../../src/include/*/*.rb
# AUTODOCS_SUBDIR: To install the result to $(docdir)/SUBDIR/autodocs
# Optional - the default is no subdir, $(docdir)/autodocs
# AUTODOCS_STRIP: Strip it from filenames. The remaining / are replaced by __
Expand All @@ -20,13 +22,28 @@ CLEANFILES = $(html_DATA) pod2htm*.tmp

AUTODOCS_YCP ?= $(wildcard $(srcdir)/../../src/*.ycp)
AUTODOCS_PM ?= $(wildcard $(srcdir)/../../src/*.pm)
AUTODOCS_RB ?= $(wildcard $(srcdir)/../../src/modules/*.rb) $(wildcard $(srcdir)/../../src/include/*/*.rb)
AUTODOCS_STRIP ?= $(srcdir)/../../src

index.html: $(AUTODOCS_YCP) $(AUTODOCS_PM)
# yard specific options
YARD ?= yard
YARD_EXTRA ?= js css
YARD_EXTRA_OPTIONAL ?= Yast

# yard specific hooks
clean-local:
rm -rf $(YARD_EXTRA) $(YARD_EXTRA_OPTIONAL)

install-data-hook:
cp -r -a $(YARD_EXTRA) "$(DESTDIR)$(htmldir)"
if [ -e "$(YARD_EXTRA_OPTIONAL)" ]; then cp -r -a $(YARD_EXTRA_OPTIONAL) "$(DESTDIR)$(htmldir)"; fi

index.html: $(AUTODOCS_YCP) $(AUTODOCS_PM) $(AUTODOCS_RB)
#including *.pm, for the index
if [ -n "$(AUTODOCS_YCP)" ]; then ${YCPDOC} -d. -s$(AUTODOCS_STRIP) $(AUTODOCS_YCP); fi
for i in $(AUTODOCS_PM); do \
b=$${i##$(AUTODOCS_STRIP)}; b=$${b#/}; b=$${b//\//__}; b=$${b%.pm}; \
pod2html --title=$$b --infile=$$i --outfile=$$b.html; \
echo "<a href='$$b.html'>$${b/__/::}</a>" > $$b.mod.html; \
done
if [ -n "$(AUTODOCS_RB)" ]; then $(YARD) doc -o . $(AUTODOCS_RB); fi
7 changes: 7 additions & 0 deletions package/yast2-devtools.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 18 07:35:47 UTC 2013 - lslezak@suse.cz

- autodocs - added support for generating documentation for ruby
files using yard generator
- 2.24.3

-------------------------------------------------------------------
Tue Jul 16 13:21:59 UTC 2013 - mvidner@suse.com

Expand Down
2 changes: 2 additions & 0 deletions yast2-devtools.spec.in
Expand Up @@ -18,6 +18,8 @@ Requires: libxslt
Requires: pkgconfig >= 0.16
Requires: automake autoconf
Requires: gettext-tools
# for building Ruby autodocs
Requires: rubygem-yard
Recommends: cmake
# /usr/lib/YaST2/bin/ydoxygen needs it
Recommends: doxygen
Expand Down

0 comments on commit 31dd002

Please sign in to comment.