Skip to content

Comments

Ddoc enhancements#6170

Merged
andralex merged 2 commits intodlang:masterfrom
jacob-carlborg:ddoc-symbol-name
Oct 11, 2016
Merged

Ddoc enhancements#6170
andralex merged 2 commits intodlang:masterfrom
jacob-carlborg:ddoc-symbol-name

Conversation

@jacob-carlborg
Copy link
Contributor

@jacob-carlborg jacob-carlborg commented Oct 2, 2016

This PR is split into two separate commits, where the later ones depend on the former ones. The commit messages describe pretty well what they do and the intention. I've copied them here for convince:

  • Ddoc: wrap each symbol in the DDOC_MEMBER macro

    This allows better control of formatting of the output. For example,
    it allows to output an unordered list instead of a description list.

    By default it expands the first argument ($0) as is, basically making
    the macro disappear, to keep backwards compatibility.

  • Ddoc: add new macros: DDOC_MEMBER_HEADER and DDOC_HEADER_ANCHOR

    The second parameter ($1) of the DDOC_HEADER_ANCHOR macro expands to
    the fully qualified name of the current symbol without the package and
    module prefix. That is, for a module level symbol it's the name of a
    symbol. For a nested symbol, like a method in a class, it's the symbol
    name prefixed with the class name. The third parameter ($2) expands to
    just the name of the current symbol.

    The DDOC_MEMBER_HEADER wraps DDOC_HEADER_ANCHOR to allow a sensible
    output format. The DDOC_MEMBER_HEADER is wrapped in the DDOC_MEMBER
    macro.

    By default these two macros expand to nothing, to keep backwards
    compatibility.

@jacob-carlborg jacob-carlborg force-pushed the ddoc-symbol-name branch 2 times, most recently from 96b168a to 3de9796 Compare October 4, 2016 16:45
@jacob-carlborg jacob-carlborg changed the title Ddoc enhancements [WIP] Ddoc enhancements Oct 6, 2016
This allows better control of formatting of the output. For example,
it allows to output an unordered list instead of a description list.

By default it expands the first argument ($0) as is, basically making
the macro disappear, to keep backwards compatibility.
The second parameter ($1) of the DDOC_HEADER_ANCHOR macro expands to
the fully qualified name of the current symbol without the package and
module prefix. That is, for a module level symbol it's the name of a
symbol. For a nested symbol, like a method in a class, it's the symbol
name prefixed with the class name. The third parameter ($2) expands to
just the name of the current symbol.

The DDOC_MEMBER_HEADER wraps DDOC_HEADER_ANCHOR to allow a sensible
output format. The DDOC_MEMBER_HEADER is wrapped in the DDOC_MEMBER
macro.

By default these two macros expand to nothing, to keep backwards
compatibility.
@codecov-io
Copy link

Current coverage is 87.38% (diff: 100%)

Merging #6170 into master will decrease coverage by <.01%

@@             master      #6170   diff @@
==========================================
  Files           104        104          
  Lines         57418      57396    -22   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          50178      50154    -24   
- Misses         7240       7242     +2   
  Partials          0          0          

Powered by Codecov. Last update 9a935f6...3de9796

@jacob-carlborg jacob-carlborg changed the title [WIP] Ddoc enhancements Ddoc enhancements Oct 11, 2016
@jacob-carlborg
Copy link
Contributor Author

@andralex ping

@andralex
Copy link
Member

Nice work, thanks!

@andralex
Copy link
Member

Auto-merge toggled on

@andralex andralex merged commit cab2c33 into dlang:master Oct 11, 2016
@jacob-carlborg
Copy link
Contributor Author

@andralex I need to update the documentation and do a minor tweak for the theme that is used in dlang.org. Where do I find that, and are there any other docs/themes that need to be updated?

@jacob-carlborg jacob-carlborg deleted the ddoc-symbol-name branch October 12, 2016 06:42
@andralex
Copy link
Member

I guess all of those should be in the https://github.com/dlang/dlang.org repo? The pertinent ddoc files are *.ddoc. For the site, https://github.com/dlang/dlang.org/blob/master/posix.mak shows how they're used:

DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME)
STD_DDOC=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST}) $(NODATETIME)

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

Successfully merging this pull request may close these issues.

3 participants