Как открыть markdown в браузере
Просмотр файлов markdown в автономном режиме [закрыто]
необходимо работать на Mac и Windows, так как я использую оба.
15 ответов
есть несколько плагинов Chrome, которые хорошо работают. Я использовал Предварительный Просмотр Markdown Plus.
после установки включите «Разрешить доступ к URL-адресам файлов» в расширениях (меню > Дополнительные инструменты > Расширения или введите URL ).
затем перетащите файл Markdown на Chrome и используйте свой любимый редактор для редактирования.
я писал сцепление некоторое время назад, чтобы сделать именно это. Это делает ровно как и на GitHub и предоставляет несколько дополнительных опций:
затем перейдите в каталог, содержащий файл README и запустите:
вот скриншот Readme захвата рендеринга захвата:
надеюсь, что это помогает. посмотреть здесь.
Атом по Github. Дает вам бок о бок предварительный просмотр.
опоздал на вечеринку, но посмотрите на MarkdownPad.
установить с помощью pip :
Он имеет, когда вы тип предварительного просмотра, выделите код, огороженные блоки кода, стиль github
он может использоваться командной строкой :
Я создал это, чтобы создать инструмент для отправки обзоров кода, он легко расширяется, импортируя его как модуль, вы можете добавлять пользовательские действия.
Я только что установил https://github.com/ypocat/gfms. Это делает очень хорошую работу рендеринга GitHub ароматизированный markdown. Он обнаруживает изменения в вашей уценке, поэтому вы просто помещаете свой браузер и редактор бок о бок. Это узел.js, поэтому он должен отлично работать на любой платформе.
Если у вас есть узел.JS установлен, установка проста:
Я рекомендую автономную версию, так что вы можете сделать ваше редактирование, даже когда вы делаете свой бизнес на престол. 🙂
вы пробовали ReText? Это хороший редактор рабочего стола Markdown
есть люди, которые не используют Google Chrome. Существует дополнение Firefox под названием Markdown Viewer который способен читать файлы Markdown в автономном режиме.
pandoc это хороший инструмент преобразования текста в текст, который решает проблему автономной визуализации вашей уценки. Просто вопрос:
нашел расширение MarkView Google Chrome довольно полезно, на самом деле это работает как шарм:
MarkView-это расширение Chrome для редактирования и просмотра файла markdown с видом контура, поддержка нескольких стилей формата таблицы, подсветка синтаксиса блока кода и Github ароматизированная Markdown.
дополнительные функции были добавлены в MarkView:
Пользовательский Стиль Документа
Мне нравится вертикальный разделитель в Downmarker, вы можете видеть изменения, как вы пишете!
Markdown Viewer от Simeon Velichkov
✚ Only Firefox Quantum >= 57 is supported!
✚ Currently file:// URLs are not supported!
✚ You have to enable all remote origins manually!
✚ Take a look at the description for more information!
Метаданные расширения
Используется
✚ Watch this short screencast first (only 3 min): https://youtu.be/c7Lb_Y092ok
✚ Only Firefox Quantum >= 57 is supported!
✚ Features
✔ Renders remote URLs
✔ Granular access to remote origins
✔ Multiple markdown parsers
✔ Full control over the compiler options
✔ Themes (including GitHub theme)
✔ GitHub Flavored Markdown (GFM)
✔ Auto reload on file change
✔ Syntax highlighted code blocks
✔ Table of Contents (TOC)
✔ MathJax and Emoji support
✔ Mermaid diagrams support
✔ Remembers scroll position
✔ URL detection using RegExp
✔ Toggle Content Security Policy (CSP)
✔ Override page encoding
✔ Settings synchronization
✔ Raw and rendered markdown views
✔ Free and Open Source
✚ Differences with the Chrome version
— Access to file URLs is not supported
— Header detection is not supported, only Path Matching
— Not an event page
Сообщить о нарушении правил этим дополнением
Если вы считаете, что это дополнение нарушает политики Mozilla в отношении дополнений, или имеет проблемы с безопасностью или приватностью, сообщите об этих проблемах в Mozilla, используя эту форму.
Не используйте эту форму, чтобы сообщать об ошибках или запрашивать новые функции в дополнении; это сообщение будет отправлено в Mozilla, а не разработчику дополнения.
Этому дополнению нужно:
Это дополнение может также запрашивать:
Web приложение для работы с markdown заметками
За долгое время у меня накопилось много различных заметок, подсказок и шпаргалок на различные темы, как связанные с it, так и совсем не связанные. Появилась необходимость это удобно и структурировано хранить.
Я попробовал различные wiki движки, но не всё мне в них нравилось, иногда функционала было недостаточно, а иногда было слишком много. Я подумал, что если хочешь сделать хорошо — сделай это сам нужно написать свой велосипед.
Мне давно хотелось написать web-приложение на Python, поэтому выбор пал на этот язык. Под катом исходный код и описание, а также ссылка на репозиторий.
Суть этого приложения заключается в следующем: есть директория с md файлами, их удобно писать и удобно использовать помимо этого приложения, если файл называется test.md, то по адресу localhost:8000/test откроется содержимого этого файла в html отображении.
Сначала создадим шаблон отображения для джинджи:
Он очень простой и использует таблицу для разделения бокового меню от основного контента.
Теперь необходимо сделать файл с конфигурацией:
check_found_file(), используемая в последнем блоке кода показывает существует ли запрашиваемый файл:
Самая главная функция в данном приложении — преобразование markdown в html:
Теперь осталось получить содержимое страницы:
И показать в браузере
Вот и всё. Заметки создаются и редактируются в любимом редакторе, а читаются в браузере.
Для синхронизации всего этого между своими устройствами можно использовать облачный сервис.
Надеюсь, это приложение поможет разложить свои заметки и записи «по полочкам» и, может быть, познакомиться и подружиться с таким прекрасным языком, как python.
Как открыть markdown в браузере
Markdown Viewer / Browser Extension
Install: Chrome / Firefox / Opera / Edge
Navigate to file:/// in your browser and locate the markdown files that you want to read
| Option | Default | Description |
|---|---|---|
| breaks | false | Enable GFM line breaks. This option requires the gfm option to be true. |
| gfm | true | Enable GFM GitHub Flavored Markdown. |
| pedantic | false | Conform to obscure parts of markdown.pl as much as possible. Don’t fix any of the original markdown bugs or poor behavior. |
| sanitize | false | Sanitize the output. Ignore any HTML that has been input. |
| smartLists | false | Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic. |
| smartypants | false | Use «smart» typographic punctuation for things like quotes and dashes. |
| Option | Default | Description |
|---|---|---|
| breaks | false | Enable GFM line breaks. This option requires the gfm option to be true. |
| footnotes | false | Toggle reference footnotes and inline footnotes. |
| gfm | true | Enable GFM GitHub Flavored Markdown. |
| sanitize | false | Sanitize the output. Ignore any HTML that has been input. |
| Option | Default | Description |
|---|---|---|
| autoreload | false | Auto reload on file change |
| toc | false | Generate Table of Contents |
| mathjax | false | Render TeX and LaTeX math blocks |
| mermaid | false | Render Mermaid diagrams |
| emoji | false | Convert emoji :shortnames: into EmojiOne images |
| scroll | true | Remember scroll position |
When enabled the extension will make a GET request every second to:
The following mathjax delimiters are supported:
The following rules apply to your content when mathjax is enabled:
The MathJax support currently works only on local file URLs and remote origins without strict Content Security Policy (CSP) set. For example it won’t work for files hosted on the GitHub’s raw.githubusercontent.com origin. However you can bypass this by enabling the Disable CSP switch for that origin.
Render Mermaid diagrams wrapped in mmd or mermaid fenced code blocks:
The Emoji support currently works only on local file URLs and remote origins without strict Content Security Policy (CSP) set. For example it won’t work for files hosted on the GitHub’s raw.githubusercontent.com origin. However you can bypass this by enabling the Disable CSP switch for that origin.
Detecting and rendering local file URLs can be enabled by using the Allow access to file URLs option for the extension.
Access to remote URLs however, needs to be enabled manually.
Here is how you can enable the extension for the https://raw.githubusercontent.com origin:
In case you really want to you can enable the extension for all origins:
Alternatively you can use the Allow All button.
Note: Take a look at the Path Matching Priority section below to see how the Markdown content is being included for or excluded from rendering!
When this option is enabled the extension will check for the presence of the text/markdown and text/x-markdown content-type header before trying to match the path:
If the header detection is disabled or a proper content-type header is missing, the extension will check if the URL is ending with a markdown file extension.
The default regular expression is: \.(?:markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text)(?:#.*|\?.*)?$
It’s a simple regular expression that matches URLs ending with:
You can modify the path matching regular expression for each enabled origin individually. The settings are being updated as you type.
Path Matching Priority
The enabled origins are matched from most specific to least specific:
Only the first matching origin is picked and then its Path Matching RegExp is used to match the entire URL. If it fails no other attempts are made to match the URL.
In this example we have allowed all origins (the last entry). It uses the default Path Matching RegExp that is going to match only URLs ending with markdown file extension.
In case we want to match a custom path we have to add a more specific origin and specify its Path Matching RegExp accordingly.
In this example we have allowed all origins (the last entry). It uses the default Path Matching RegExp that is going to match only URLs ending with markdown file extension.
The problem is that some origins may serve rendered HTML content on URLs ending with markdown file extension.
In this case we want to exclude the github.com origin altogether and for that we have to add more specific origin and set its Path Matching RegExp to something that’s impossible to match.
In this example we have allowed all origins (the last entry). It uses the default Path Matching RegExp that is going to match only URLs ending with markdown file extension.
The problem is that some origins may serve rendered HTML content on URLs ending with markdown file extension.
In this case we want to match only URLs containing the raw word in their path and for that we have to add more specific origins and set their Path Matching RegExp accordingly.
At any point click on the REMOVE button for the origin that you want to remove. This actually removes the permission itself so that the extension is no longer able to inject code into that origin.
Note that the Chrome’s consent popup shows up only when you add the origin for the first time. In case you re-add it you’ll no longer see that popup. That’s a Chrome thing and it’s not controllable through the extension.
The extension synchronizes your preferences across all of your devices using Google Sync. The list of your allowed origins is being synced too. However, the actual permissions that you grant using the Chrome’s consent popup cannot be synced.
In case you’ve recently added a new origin on one of your devices you’ll have to explicitly allow it on your other devices. In this case additional refresh label will be shown for each origin that needs to be refreshed. This label is present only on those devices that needs to be refreshed. Expanding the origin will reveal additional REFRESH button:
Disable Content Security Policy
Some remote origins may serve its content with a content-security-policy header set that prevents the extension from executing certain JavaScript code inside the content of that page. For example on raw.githubusercontent.com certain things such as remembering your scroll position, generating TOC, displaying MathJax or Emojis won’t work.
Using the Disable Content Security Policy switch you can optionally tell the extension to strip that header from the incoming request and therefore allow its full functionality to work:
Note that the Content Security Policy header will be stripped only if the URL matches the corresponding Path Matching RegExp for that origin.
Even if you have Allowed All Origins and disabled the Content Security Policy at the same time, the header will be stripped only for those requests with URL that matches your explicitly set Path Matching RegExp for the Allow All origin *://*
In Firefox the character encoding is set always when enabled.
Markdown Syntax and Features
A separate repository containing examples about: markdown syntax, syntax highlighting in code blocks, mathjax etc. is hosted on all major Git hosting providers: GitHub, GitLab, BitBucket.
Allow the appropriate origin to render the raw markdown files directly on: GitHub, GitLab, BitBucket, or pull any of these repositories locally and play around with the extension’s options.
Markdown Viewer can be used with any markdown parser/compiler. Currently the following compilers are implemented: marked, remark, showdown, markdown-it, remarkable, commonmark, markdown-js.
Note that in this case you won’t receive any future updates automatically.
Note that in this case you won’t receive any future updates automatically.
You can use the Opera’s official browser extension for installing Chrome extensions from Google Chrome Web Store to install Markdown Viewer.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Markdown Viewer
Я нашел файл, отформатированный с помощью Markdown. Не могли бы вы, ребята, предложить, какой просмотрщик я мог бы использовать для просмотра файлов такого типа? Надеюсь, один без графического интерфейса (если это возможно)
Обновление Я действительно искал средство просмотра, которое могло бы анализировать формат файла разметки, который не нуждается ни в каком преобразовании. Но что-то близкое к этому должно быть в порядке.
Следующий веб-сайт предоставляет инструмент, который будет переводить уценку в HTML:
После того, как вы конвертируете файл в HTML, есть несколько инструментов командной строки, которые можно использовать для просмотра файла. Используя тестовый файл, который содержит форматированный текст уценки, я обнаружил, что следующее работает хорошо.
Все эти инструменты должны быть доступны для Slackware.
Использование pandoc и lynx без создания временных файлов:
Я написал облегченное средство просмотра разметки терминала на python, для CLI или как lib:
Он поддерживает, например, таблицы, предупреждения и тонны цветовых тем.
Примечание : кредиты на ответ @ Джо в переполнении стека.
Установите его с помощью pip :
Чтобы отобразить файл example.md :
Однако, если вам нужно увидеть файл ReText из терминала, одним из вариантов может быть преобразование marddown в html с помощью pandoc и просмотр html-копии в lynx :
редактировать
Для систем * nix доступно еще несколько бесплатных редакторов уценки с предварительным просмотром. Некоторые в официальных репозиториях, другие нет, и у каждого свои сильные и слабые стороны, но как подходящие зрители я хотел бы подчеркнуть следующее:
Typora : Он все еще находится в бета-фазе, но пока что он бесплатный (неясно, как будет лицензироваться стабильная версия). Хотя это и не FOSS, он идеально подходит для просмотра разметки, поскольку по умолчанию он работает почти как редактор WYSIWYG («режим предварительного просмотра в реальном времени») с панелью Outline (оглавление), что очень удобно для больших файлов. «Режим исходного кода» имеет подсветку синтаксиса, включая большие шрифты для заголовков и курсив для выделения. И не только экспорт в HTML, ODT и PDF. Также можно импортировать-экспортировать в несколько форматов через pandoc интеграцию.
MdCharm : аналогично Retext, но поддерживает уценку (дополнительная скидка) и MultiMarkdown. Показать также контурную (ToC) панель.













