Skip to content
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

Get all headings for table of contents #174

Open
Wulfheart opened this issue May 18, 2020 · 6 comments
Open

Get all headings for table of contents #174

Wulfheart opened this issue May 18, 2020 · 6 comments

Comments

@Wulfheart
Copy link

Hello,

is it possible to get all headings from a string in an extension? I need this for autogenerating a table of contents.

Thank you in advance

@cebe
Copy link
Owner

cebe commented Oct 7, 2020

There is an implementation of this in yii2-apidoc package:

https://github.com/yiisoft/yii2-apidoc/blob/e56aa1f065e4ece1a68b21de653b02ed0da2dadd/helpers/ApiMarkdown.php#L94-L121

could be useful to extract this into a trait and add it to this package. Happy to review and merge pull requests for this.

@akshitagupta20
Copy link

@cebe
Hi, I would like to contribute. How should I proceed?

@cebe
Copy link
Owner

cebe commented Oct 9, 2020

@akshitagupta20 Hi, thanks for offering help. The solution would be a trait, that can be added to a custom markdown class:

<?php

class MyCustomMarkdown extends Markdown
{
     use HeadlineExtractionTrait;
// ..
}

HeadlineExtractionTrait should be a class from this repo and should contain the code similar to the one linked above, providing the collection of headlines as well as a getHeadlines() method.

Hope that is clear, feel free to ask more detailed question.

@akshitagupta20
Copy link

akshitagupta20 commented Oct 15, 2020

I am really new with Open-Source and I am very much interested in contributing not just cause of Hacktoberfest, so can you please further guide me how to solve this issue.
If you could spare some time, Es wäre eine große Hilfe.

@Ayushman00100
Copy link

@cebe
Hi, I would like to contribute. How should I proceed?

@cebe
Copy link
Owner

cebe commented Nov 21, 2021

I already explained it above, please ask more concrete question.

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

No branches or pull requests

4 participants