pycco-docs / pycco

Literate-style documentation generator.

Home Page:https://pycco-docs.github.io/pycco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for languages with multiple comment styles

treyhunner opened this issue · comments

Languages like PHP have multiple comment styles (// and # for single line comments). Currently the code only supports one single-line comment style and one multi-line comment style (optionally).

Two possible solutions:

  1. Turn "symbol" definition into a List of symbol styles or allow a List to be specified optionally. PHP support could then be added like this:

    ".php": { "name": "php", "symbol": ["//", "#"]}
    
  2. Use regular expressions for "symbol", "multistart", and "multiend". PHP support could then be added like this:

    ".php": { "name": "php", "symbol": r"//|#"}
    

This would also allow both of python's very common docstring formats to be supported:

"""
3 double quotes
"""

'''
3 single quotes
'''

Currently on the first is supported, they are both equally valid.