Skip to content

Add ability to describe an introduction text #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Undistraction opened this issue Oct 11, 2014 · 15 comments
Closed

Add ability to describe an introduction text #256

Undistraction opened this issue Oct 11, 2014 · 15 comments
Assignees
Labels
Milestone

Comments

@Undistraction
Copy link

It would be great to be able to add an Introduction to the documentation. just something to sit above the generated docs in the main column (in the default theme).

If I have a README outlining how the library should be used and full of examples, it would seem to me this should be something that I can include into the docs as an introduction. I'd love to be able to just direct to the Sassdoc from the README, but pure docs without context mean I'm going to end up boiling a lot of the docs down into the README. Being able to consolidate intro and docs would make both docs and introduction stronger.

This could be expanded to allow links from the intro to the relevant docs (perhaps just parsing out known entities from the text and adding links automagically).

@KittyGiraudel
Copy link
Member

If we want to add an introduction text, we will probably keep it very simple: a string parsed as Markdown, injected into the DOM. I'm okay with that.

Edit: depending on the outcome of this issue, we'll move it to sassdoc-theme-default since it is strictly related to the theme at this point.

@KittyGiraudel KittyGiraudel added this to the 2.1 milestone Oct 11, 2014
@FWeinb
Copy link
Member

FWeinb commented Oct 12, 2014

Maybe we could even allow to include a README.md right from the project root.

@Undistraction
Copy link
Author

I think a choice of either the README or the name of a .md file would be perfect.

@KittyGiraudel
Copy link
Member

Maybe we could even allow to include a README.md right from the project root.

I don't like this. I don't want people to write their README in some way because of SassDoc. Although we could allow either a markdown file (if string is a path), or a description as a string directly.

@FWeinb
Copy link
Member

FWeinb commented Oct 13, 2014

Adding the ability to put a path in the configuration file is fine with me. Do we move this to the default theme?

@KittyGiraudel
Copy link
Member

@valeriangalliat, @pascalduez, okay?

@KittyGiraudel KittyGiraudel changed the title Support for Introduction Text Add a way to describe an introduction text Oct 13, 2014
@valeriangalliat
Copy link
Member

Yep.

@pascalduez
Copy link
Member

A path in config is fine. Let's go !

@KittyGiraudel
Copy link
Member

Alright, so the scenario is:

  • try require() on view.description;
    • if it works, put content from required file in view.description;
    • if it fails, quit (view.description is already a description).
  • parse it as Markdown with sassdoc-extras;
  • display it in sassdoc-theme-default on top of main container;
  • write docs.

Who takes it? I can take the theme/docs stuff.

@valeriangalliat
Copy link
Member

require is only for JavaScript or JSON files… and you want a string back. You want something like module.exports = 'description';?

Or you probably mean fs.readFile.

@KittyGiraudel
Copy link
Member

You get the idea. If it's a path, get content, else treat content as content.

@KittyGiraudel KittyGiraudel changed the title Add a way to describe an introduction text Add ability to describe an introduction text Nov 26, 2014
@KittyGiraudel
Copy link
Member

Regarding this (part of 2.1), there is something I don't like much. When taking an actual package.json file as a package, there is absolutely no way that the description ends up being a path to a Markdown file. This is not how description works as per the package spec or whatever you want to call this.

@KittyGiraudel
Copy link
Member

What would be the best way to tackle this one? I'm thinking of:

  • Add a description (or fullDescription or whatever) key to the configuration
  • If it is a string, parses it as Markdown
  • if it is a path, get content and parses it as Markdown

Thoughts @SassDoc/owners?

@pascalduez
Copy link
Member

Add a description (or fullDescription or whatever) key to the configuration
If it is a string, parses it as Markdown
if it is a path, get content and parses it as Markdown

Looks perfect. Exactly what I had in mind.

@pascalduez
Copy link
Member

It's a theme feature.
Moved to SassDoc/sassdoc-theme-default#66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants