Support raspberry flavoured markdown#67
Draft
rammodhvadia wants to merge 14 commits intomainfrom
Draft
Conversation
3 tasks
There was a problem hiding this comment.
Pull request overview
Adds support for “RFM” (GitHub-alert-style) Markdown constructs alongside the existing legacy --- block --- RPF syntax, enabling blockquote markers like [!HINT], [!TASK], etc., and fenced code metadata to be parsed into existing RPF HTML components.
Changes:
- Introduces an RFM parser extension that recognizes
[!MARKER]blockquotes and RPF-metadata fenced code blocks. - Adds a tree pass to group adjacent RFM hints into a single legacy “hints panel”.
- Extends the HTML converter and test fixtures/specs to cover the new RFM examples and behavior.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/kramdown_rpf_spec.rb | Adds RFM conversions to fixture-driven tests and adds direct unit-style specs for RFM syntax behaviors. |
| lib/kramdown_rpf/rpf_helpers.rb | Extracts shared conversion helpers for handling Hash-backed RFM elements and code metadata rendering. |
| lib/kramdown_rpf/rpf.rb | Updates converters to accept RFM element shapes (Hash values), adds debug/tip callout conversion, and refactors code conversion via helpers. |
| lib/kramdown_rpf/rfm_hint_grouping.rb | Adds AST pass to group adjacent RFM hint blockquotes into a single :hints element. |
| lib/kramdown_rpf/rfm.rb | Adds RFM parsing for [!...] blockquotes and for fenced code blocks that include RPF metadata attributes. |
| lib/kramdown_rpf/kramdown.rb | Wires in the RFM parser module and adds converter handlers for :debug and :tip; adjusts hint conversion for RFM single-hint panels. |
| examples/accordion/rfm_accordion.md | New example fixture for RFM accordion marker parsing. |
| examples/accordion/rfm_accordion.html | Expected HTML output for RFM accordion example. |
| examples/accordion/rfm_accordion_with_code.md | New example fixture for RFM accordion containing embedded HTML/code. |
| examples/accordion/rfm_accordion_with_code.html | Expected HTML output for accordion-with-code example. |
| examples/accordion/rfm_accordion_with_space.md | New example fixture for RFM accordion embedded within list content/whitespace scenarios. |
| examples/accordion/rfm_accordion_with_space.html | Expected HTML output for accordion-with-space example. |
| examples/accordion/rfm_accordion_in_challenge.md | New example fixture for nested RFM accordion inside an RFM challenge. |
| examples/accordion/rfm_accordion_in_challenge.html | Expected HTML output for accordion-in-challenge example. |
| examples/challenge/rfm_challenge.md | New example fixture for RFM challenge marker parsing. |
| examples/challenge/rfm_challenge.html | Expected HTML output for RFM challenge example. |
| examples/code/rfm_code_fenced.md | New example fixture for fenced code blocks with RPF-style metadata in the info string. |
| examples/code/rfm_code_fenced.html | Expected HTML output for fenced RFM code-with-metadata example. |
| examples/debug/rfm_debug.md | New example fixture for RFM debug callout marker parsing. |
| examples/debug/rfm_debug.html | Expected HTML output for RFM debug callout example. |
| examples/hint/rfm_hint.md | New example fixture for a single RFM hint marker. |
| examples/hint/rfm_hint.html | Expected HTML output for a single RFM hint rendered as a hints panel with one slide. |
| examples/hint/rfm_hints.md | New example fixture for multiple adjacent RFM hints to be grouped. |
| examples/hint/rfm_hints.html | Expected HTML output for grouped RFM hints panel. |
| examples/no_print/rfm_no_print.md | New example fixture for RFM no-print marker parsing. |
| examples/no_print/rfm_no_print.html | Expected HTML output for RFM no-print wrapper example. |
| examples/print_only/rfm_print_only.md | New example fixture for RFM print-only marker parsing. |
| examples/print_only/rfm_print_only.html | Expected HTML output for RFM print-only wrapper example. |
| examples/save/rfm_save.md | New example fixture for RFM save marker parsing. |
| examples/save/rfm_save.html | Expected HTML output for RFM save panel example. |
| examples/task/rfm_task.md | New example fixture for RFM task marker parsing. |
| examples/task/rfm_task.html | Expected HTML output for basic RFM task example. |
| examples/task/rfm_task_with_hints.md | New example fixture for RFM task containing nested RFM hints. |
| examples/task/rfm_task_with_hints.html | Expected HTML output for task-with-hints (grouped hints panel). |
| examples/task/rfm_task_with_ingredient.md | New example fixture for RFM task containing nested RFM accordion ingredient. |
| examples/task/rfm_task_with_ingredient.html | Expected HTML output for task-with-ingredient example. |
| examples/tip/rfm_tip.md | New example fixture for RFM tip callout marker parsing. |
| examples/tip/rfm_tip.html | Expected HTML output for RFM tip callout example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+158
to
+165
| def parse_codeblock_info_string(info_string) | ||
| tokens = shellwords_split(info_string) | ||
| language = tokens.shift.to_s | ||
| meta = {} | ||
|
|
||
| tokens.each do |token| | ||
| key, value = token.split('=', 2) | ||
| next unless value && CODE_META_KEYS.include?(key) |
Comment on lines
1
to
5
| # frozen_string_literal: true | ||
|
|
||
| require 'kramdown' | ||
| require_relative 'rpf_helpers' | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.