Closed davebalmer closed 13 years ago
I'll do #3, but fall back to #1 if there are no h1 tags. Trying to figure out how to do autolinking correctly between multiple files.
The only danger with #3 is it might make it harder for users to keep solid bookmarks to pages if the filenames are subject to change along with heading text (or reordering within a given file). I think we should think about this a bit more, I'm leaning toward #2, but it has its issues as well (e.g. if the file folders get moved around, all the filenames get changed). Maybe we take a hybrid of #1, and add some unique addition to the filename (_01, _02, etc), and throw up a warning during the build. Seems like most cases simply using the same filename out as in (with extension change) would be fine.
Sounds good. And it will make autolinking much easier between files.
Not sure I'm happy about keeping the directory structure. What happens with files outside the directory where jodoc was run (e.g. ../../src or /usr/src/blahblah/)?
Going with the filename-munger approach, not 100% sure about the munging scheme (all the underscores look awkward), but it sure does work. Closing for now.
Was thinking of the best way to handle filename generation for multiple files out. A few choices present themselves:
../js/core/myclass.js
is output to a file named___js_core_myclass.js
. In this munging scheme, I'm replacing the.
and/
with underscores (in windows, would we replace the\
characters too?)<h1>
tag we see in a file and use that as the filename, wikipedia style. From../js/core/mylib.js
we might get an output file like:MyLib.Core.html
. And something more esoteric likeREADME
might become:Using_My_Lib.html
(maybe lowercase everything, too?).I think #3 may be the most useful, open to suggestion.