Conversion from block mark-up to/from Markdown
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
Línea de trabajo
Start by reviewing the related wp-cli/ideas issue and the linked wxr converter to understand existing approaches to block markup conversion. A complete result would define the supported export and import scope, configurable Markdown handling, standard block handlers, and behavior for unknown blocks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
Export from existing WordPress installation's Gutenberg pages to Markdown for interop with other content engines or to LLMs which tend to like Markdown. Import would also be great. My usecase is to convert to Markdown the block markup syntax strings found in WXR files exported from an existing WP installation.
Describe the solution you'd like
Versatile / configurable export from block markup to Markdown. Custom attributes can be optionally exported via CommonMark Directive syntax which already has support in remark. Even if conversion is not 100% faithful, it is already useful: e.g. for making existing WordPress content consumable in good form for RAG / LLMs.
There are a lot of various existing markdown plugins for WordPress, but there is a need for a well-tested official one (which will be maintained, currently maintenance is also fragmented, there are plenty of abandoned exporters), but versatile one which can be scripted, so it's a good fit for CLI command, in my opinion.
Ideally, there must be handlers for standard block types, and some catch-all for optionally exporting verbatim HTML for the blocks which do not have registered markdown converter. Having some HTML in Markdown is also fine, as the user can then postproc the markdown files with remark/rehype pipelines.
IMO such exporter should accept that there does not exist a single right way to export to Markdown so some configurability is to be expected, as users may want to get different flavors of Markdown (e.g. both preserving the text color as Directives, or just dropping it altogether are good and useful, depending on the user's usecase).
Related:
For now, I had to roll my own https://github.com/vadimkantorov/wxr for exporting block markup from WXR to HTML files (preserving attributes), and then for converting them to Markdown (and also allowing some custom URL / image URL postprocessing / downloading the linked images etc). In this converter I'm often representing unknown blocks as:
---
blah blah some info about a block without a standard way to represent in Markdown (not frontmatter)
---
more markdown
So essentially using a pair of --- dividers to enclose some block info. Then a custom remark/rehype pipeline could interpret / render these in a custom way if a user desires so.
- Lenguaje dominante
- PHP
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 6 min
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
sync-en
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
sync-en
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
Перевод устарел
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
priority: p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nextcloud/fulltextsearch#1011 ·