Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

body of a fn is being reproduced as verbatium code in docs #4

Closed
brehaut opened this issue Dec 22, 2010 · 3 comments
Closed

body of a fn is being reproduced as verbatium code in docs #4

brehaut opened this issue Dec 22, 2010 · 3 comments

Comments

@brehaut
Copy link

brehaut commented Dec 22, 2010

The function 'parse-bool' at https://github.com/brehaut/necessary-evil/blob/master/src/necessary_evil/value.clj#L38-41

(defn parse-bool [v] (condp = (.trim (text v))
                         "0" false
                         "1" true
                         "throw exception here"))

is being output in the uberdoc.html with the following as a verbatim code block in the doc column beside an abbreviated piece code:

                      "0" false
                      "1" true
                      "throw exception here"))
    (defn parse-bool [v] (condp = (.trim (text v))
@zk
Copy link
Collaborator

zk commented Dec 22, 2010

Yeah, the code that parses docstrings is pretty brittle, it looks at the next line after a defn and if it sees a quote as the first non-whitespace character it assumes it's a docstring.

Work's in progress to find a more robust solution, keep an eye on https://github.com/fogus/marginalia/issues#issue/3 to follow the progress.

@fogus
Copy link
Collaborator

fogus commented Dec 23, 2010

Until we work out a better parser a fix for your particular problem is to change your code to:

(defn parse-bool [v]
  (condp = (.trim (text v))
      "0" false
      "1" true
      "throw exception here"))

@zk
Copy link
Collaborator

zk commented Dec 23, 2010

I ended up going down the rabbit hole on trying to use the c.l.LispParser, so here's a temporary fix.

c7aa687
80e4be8

See the problem-cases.general namespace for the working example.

joshuaeckroth pushed a commit to joshuaeckroth/marginalia that referenced this issue Nov 9, 2011
…x for issue clj-commons#4 highlighted. Updated example-output/uberdoc.html.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants