Skip to content

Commit

Permalink
[ansible] Add markdown mimetype support automatically
Browse files Browse the repository at this point in the history
This is needed for
https://addons.mozilla.org/en-US/firefox/addon/markdown-viewer-webext/
to work properly with local markdown files.

Also see Cimbali/markdown-viewer#2
  • Loading branch information
phansch committed Feb 13, 2018
1 parent 1eb5821 commit 5285b82
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ansible/playbooks/additional_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,24 @@
shell: update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
- name: Set nvim as editor alternative
shell: update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
- set_fact:
file_content: >
<?xml version="1.0"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/plain">
<glob pattern="*.md"/>
<glob pattern="*.mkd"/>
<glob pattern="*.markdown"/>
</mime-type>
</mime-info>
- name: Create new markdown mimetype file
become: no
file: path=~/.local/share/mime/packages/text-markdown.xml state=touch
- name: Insert content into mimetype file
become: no
copy: content={{ file_content }} dest=~/.local/share/mime/packages/text-markdown.xml
- name: Update mime database
become: no
shell: update-mime-database ~/.local/share/mime


0 comments on commit 5285b82

Please sign in to comment.