realm / jazzy

Soulful docs for Swift & Objective-C
https://realm.io
MIT License
7.34k stars 413 forks source link

Hide MARK:- #857

Open drekka opened 7 years ago

drekka commented 7 years ago

Is it possible to stop Jazzy from adding any MARK:- as subtitles in the generated html?

I used them quite extensively to help organise my methods, but I don't want them in the generated documentation.

johnfairh commented 7 years ago

Nope, it's a feature that they're carried through. You could try hiding them via CSS - the section-name class is the one for those subtitles and task-name-container for the div around that.

edit: or take a copy of whichever theme you are using and edit that as you please, eg. taking out these parts.

reitzig commented 7 years ago

A way to hide obsolete MARKs would be great. Example:

class Foo {
    // MARK: Doing Stuff

    /// ...
    public func foo() { ... }

    // MARK: Helpers

    /// ...
    fileprivate func bar() { ... }
}

Now, both MARKs would show even though the second one quite obviously marks nothing.

Proposal: drop MARKs which are not followed by an actual documented symbol, but by EOF or another MARK.

Maybe this can be worked around with using CSS as well, but it sure is not immediate.

reitzig commented 7 years ago

Never mind, apparently Jazzy already does what I propose. :'D

drekka commented 7 years ago

I managed to hide the marks by adding my own css file and hiding them. Ugly but worked. I used this in my CSS:

div.task-name-container {
    display:none;
}
.main-content ul {
    margin-bottom:0;
} 

And then added this to my jazzy command:

--head '<link rel="stylesheet" type="text/css" href="files/My.css" /><link rel="stylesheet" type="text/css" href="../files/My.css" />'

Note that I had to add it twice using two different URLs. This solves the issue where CSS files are reference both in the root of the documentation and in subdirectories. If there is a better way of handling this, I'd like to know.

reitzig commented 7 years ago

@drekka Thanks for sharing! I already hack the CSS, but I for one don't want to hide all marks everywhere, but only those that don't make sense (cf. #780).

FWIW, I maintain my custom CSS in its own file, and do this after Jazzy has run:

cat doc/custom.css >> build/doc/css/jazzy.css