Conflicts: README.markdown project.clj src/cd_client/core.clj Man, this was an ugly merge.
In local mode, searches can be done on exact strings, or using a regex pattern. Changed fixup-name-url so it escapes all possible special characters that can appear in a URL using clj-http.util/url-encode, as opposed to the small subset of special characters it handled before.
After all, if anything Clojure functions need examples of use in their doc strings, it is especially the ones that help you find examples of use for other Clojure functions :-)
Remove blank lines at beginning and end of examples and comments. Print lines of ~~~ only as separators between examples and comments, instead of before each one. For now, don't print "Last Updated" times for examples and comments. I'll add an option to print them from the REPL later.
cdoc combines the output of doc, pr-examples, pr-see-also, and pr-comments.
to avoid polluting the namespace of those who use this.
responses. TBD: Is there a way to make this definition, and the other vars, private to the cd-client.core namespace? Fixed a bug in fixup-name-url, probably due to a change in the clojuredocs.org server code.
without using the Internet at all. The file test/partial-snapshot.clj can be used to test this capability on a partial snapshot of clojuredocs contents. See comments in that file for how to use it.
fixup-name-url is called when creating URLs to retreive from clojuredocs.org. It expects symbols with a few special characters in them like . ? / to be replaced with other strings. Without this change, symbols like string? and .. cannot be searched for, and symbols like char? will return results for char instead.
…ctly handle macros and special form names Complete list of functions changed to macros: examples, pr-examples, comments, pr-comments, see-also, browse-to. I made sure to keep their 'interfaces' the same, i.e. they could either take one or two arguments. Something close to the original functions are still there, with '-core' appended to their names. Those functions are simplified a little in that they only need to work given a full namespace and name, as strings. handle-fns-etc is where the work is done checking for special forms and syntax symbols. It was inspired from looking at the source for Clojure's doc macro.
Added ability to use just a var to search for examples, comments or see-also. Added function for browsing to the clojuredocs url in OS default browser, (browse-to ...) Pretty-printing functions for examples and comments (thanks Zach).
Hopefully this makes it a bit more human-readable until we figure out a better solution for storing examples.