Is there a way to render a summary by short circuiting or truncating the rendering?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
Is there an extension to render a summary of markdown text by truncating the content after a set number of words?
For example, suppose I'm building a site where people write articles in markdown. But on the home page, I want to display the first 300 words of each article. I'd like to avoid rendering the whole thing and then parse the HTML to find the first 300 words (while properly closing any open tags). It'd be nice if there's a way I could do it as MarkDig is parsing (or rendering) the markdoown.
If no such thing exists, I could try to implement this myself, but would appreciate some hints as to how I'd go about it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin by tracing Markdig's parsing and rendering extension points to determine where truncation could occur before full output is produced. Done means a documented way to generate a summary limited to a word count while preserving valid markup, with behavior for open formatting and other block elements defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100