Giter Club home page Giter Club logo

hanna's Introduction

Hanna

Hanna is an RDoc generator built with simplicity, beauty and ease of browsing in mind.

Installation

gem install hanna

Usage

rdoc -o doc -f hanna lib

An alternative is to set the ‘RDOCOPT` environment variable:

RDOCOPT="-f hanna"

This will make RDoc always use hanna unless it is explicitly overridden.

Integrating with RubyGems

If you put the following line in your .gemrc, this will make RubyGems use Hanna for all rdoc generation:

rdoc: -f hanna

After doing this, if you wish to have documentation for all your installed gems to be formatted in hanna:

gem rdoc --all --overwrite

Rake task

For repeated generation of API docs, you can set up a Rake task. Set hanna as the RDoc generator:

require 'rdoc/task'
RDoc::Task.new do |rdoc|
  rdoc.generator = 'hanna'
end

Modification to RDoc

Hanna makes a small modification to RDoc to generate more friendly documentation. It changes label lists to use a table instead of a description list, since it is very difficult to get visually appealing styling for description lists without cutting corners (like using fixed widths).

Contributors

The Hanna template was created by Mislav and since then has seen contributions from:

  1. Tony Strauss, who participated from the early start and made tons of fixes and enhancements to the template.

  2. Michael Granger who maintained the original RDoc template.

  3. Hongli Lai with the search filter for methods.

  4. Erik Hollensbe a serious refactoring and up to date with RDoc 2.5.x and 3.x, now named ‘hanna-nouveau’.

  5. James Tucker minor cleanups and RubyGems integration

  6. Jeremy Evans RDoc 4+ support, switch from haml/sass to erb, maintenance since 2014.

hanna's People

Contributors

mislav avatar jeremyevans avatar designingpatterns avatar raggi avatar erikh avatar janko avatar foobarwidget avatar quatauta avatar djwhitt avatar drbrain avatar quintus avatar

Stargazers

Adam Daniels avatar 蒼時弦や avatar Stanislav (Stas) Katkov avatar Tino Thamjarat avatar Cristian Molina avatar Vesa Vänskä avatar  avatar Clément Joubert avatar Diego Toral avatar Yiorgos Michokostas avatar Huy Do avatar Vasily Kolesnikov avatar Estevão Mascarenhas avatar Olivier Lacan avatar  avatar Daniel Barrows avatar Robert Audi avatar  avatar matias avatar Tommaso Barbato avatar Thiago Silva Ferreira avatar Mauko Quiroga-Alvarado avatar Jesse Chavez avatar  avatar Jessica Claire Edwards avatar Christopher Giroir avatar Joel VanderWerf avatar Cliff Rowley avatar Jason Lee Ertle avatar Will Hamilton avatar Max Woolf avatar  avatar Dave Ungerer avatar Eumir Gaspar avatar Jits avatar  avatar Jean Uchôa avatar Johnson Qu avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

hanna's Issues

I can't get 'gem rdoc --all --overwrite' to reformat using hanna

In Windows 10 using pik with ruby 2.2.5 (other versions as well, same problem);

I added to my .gemrc file:
rdoc: -f hanna

I set my environment variable as follows:
RDOCOPT=-f hanna

I rebooted and ran:
gem rdoc --all --overwrite

then I typed:
gem server

Then I browsed:
http://localhost:8808

I don't see the nice hanna format, instead I see the format defined as:

Generated by RDoc 5.0.0.
Based on Darkfish by Michael Granger.

when i simply run rdoc in my gem directory, it all works beautifully for my wip gem, but not installed gems

Note: I am new to RDoc

Thanks!

Doesn't work with bundle --pre

Using gem install bundler --pre I get this error:

Unfortunately, the gem hanna-nouveau (0.2.4) has an invalid gemspec. As a result, Bundler
cannot install this Gemfile. Please ask the gem author to yank the bad version
to fix this issue. For more information, see http://bit.ly/illformed-requirement.

[Patch] Correct "Parent" for classes

Hi there,

In the documentation for classes and modules, hanna shows a "parent" attribute at the top, like this:

CLASS Foo
foo.rb
Parent: foo.rb

I think that "parent" once was to be meant as "superclass" because it doesn't make sense to list the definition file twice. I wrote a patch that does the following:

  • Show "Parent" only for real classes, not modules
  • Use the superclass method instead of parent to get the real code parent

Here's the patch:

--- a/lib/hanna-nouveau/template_files/page.haml
+++ b/lib/hanna-nouveau/template_files/page.haml
@@ -26,11 +26,14 @@
         %li
           %a.show{ :href => '#', :onclick => 'this.parentNode.parentNode.className += " expanded"; this.parentNode.removeChild(this); return false' } show all

-  - if values[:entry].parent 
+  - if !file_page && values[:entry].type == "class"
     .parent
       Parent:
       -# FIXME helper method
-      %strong= link_to values[:entry].parent.name, Pathname.new(class_dir) + Pathname.new(values[:entry].parent.path).relative_path_from(Pathname.new values[:
+      - if values[:entry].superclass.kind_of?(String)
+        %strong= values[:entry].superclass
+      - else
+        %strong= link_to values[:entry].superclass.name, Pathname.new(class_dir) + Pathname.new(values[:entry].superclass.path).relative_path_from(Pathname.ne

   - if values[:entry].respond_to?(:last_modified) and values[:entry].last_modified
     .last-update

Thanks for consideration.

Vale,
Marvin

Error in gem-dependency

I get a

Illformed requirement ["#YAML::Syck::DefaultKey:0x4772f78 3.0.25"]

after installing the gem.

Same issue can be seen when you have a look at the Runtime dependencies on the gems homepage on rubygems.

HAML dependency 3.1...

Got this while using hanna-nouveau from bundler using git as source...

Bundler could not find compatible versions for gem "haml":
  In Gemfile:
    hanna-nouveau (>= 0) ruby depends on
      haml (= 3.0.25) ruby

    haml (3.1.3)

Example

A link to an online example in the README would be nice addition.

Become offical hanna or rename

Seems to me that since this is supported and the original hanna is no longer being maintained, then this project should become the official "hanna" project.

But if for some reason that can't come to pass (e.g. can't get hold of original authors), I suggest renaming this project to just nouveau and be done with it.

The current name suggests a plugin for hanna.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.