Giter VIP home page Giter VIP logo

Comments (2)

tlnagy avatar tlnagy commented on July 3, 2024

Bump

from docstringextensions.jl.

mortenpi avatar mortenpi commented on July 3, 2024

The space between the items comes from Base, so DocStringExtensions can't really change that. But putting the name and docstring on the same line would be better indeed.

I'm busy with Documenter myself, but I would happily review a PR for this.

  • It shouldn't be too hard to update
    function format(::TypeFields, buf, doc)
    local docs = get(doc.data, :fields, Dict())
    local binding = doc.data[:binding]
    local object = Docs.resolve(binding)
    # On 0.7 fieldnames() on an abstract type throws an error. We then explicitly return
    # an empty vector to be consistent with the behaviour on v0.6.
    local fields = isabstracttype(object) ? Symbol[] : fieldnames(object)
    if !isempty(fields)
    println(buf)
    for field in fields
    print(buf, " - `", field, "`\n")
    # Print the field docs if they exist and aren't a `doc"..."` docstring.
    if haskey(docs, field) && isa(docs[field], AbstractString)
    println(buf)
    for line in split(docs[field], "\n")
    println(buf, isempty(line) ? "" : " ", rstrip(line))
    end
    end
    println(buf)
    end
    println(buf)
    end
    return nothing
    end
  • It is still possible for the user to specify longer (multi Markdown block) docstrings for fields. I think those should still be handled the way it works at the moment. But I think we need a way to determine that it is a multi-block string. But I think it could be something as simple as just parsing the Markdown, checking how many blocks we have and then throwing away the parsed result.

from docstringextensions.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.