Comments (7)
Alternative would be to identify .md documents as Evidence using some other method.
Eg
---
md_flavour: Evidence
---
etc
Regarding rendering on Github and other platforms, there is an interesting thread about R markdown here, which might be instructive: https://yihui.org/en/2018/10/rmd-github/
from evidence-vscode.
@archiewood, we can certainly identify when we load emd
markdown document.
The problem with the current emd
language config is that it overwrites default markdown document Preview, Outline and rendering when .md
documents are created or open in VS Code.
I outlined the solution we'll pursue to resolve this issue in this slack thread.
Brief notes:
- VS Code uses
markdown-it
engine. - In order to tap into it, we'd need to create evidence
markdown-it
plugin. - Then we need to enable custom markdown plugins in
package.json
by addingmarkdown.markdownItPlugins
ext. contribution point. - Then we should create our own custom .md preview that will render your app content via new Preview in simple browser added in sprint 1, or via
markdown.showPreview
if there is no customemd
content in the loaded.md
doc.
Then and only then we can make everything work without breaking default markdown Preview in vscode. Example of hooking up custom markdown-it
plugin in vscode extension:
import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';
export function activate(context: vscode.ExtensionContext) {
const md = require('markdown-it')();
const extPath = context.extensionPath;
const customPluginPath = path.join(extPath, 'customPlugin.js');
const customPlugin = fs.readFileSync(customPluginPath, 'utf8');
md.use(require(customPlugin).extendMarkdownIt);
context.subscriptions.push(
vscode.commands.registerCommand('extension.previewMarkdown', () => {
const editor = vscode.window.activeTextEditor;
if (editor) {
const document = editor.document;
const uri = document.uri;
if (uri.scheme === 'file') {
vscode.commands.executeCommand('markdown.showPreview', uri);
}
}
})
);
}
from evidence-vscode.
Then we should create our own custom .md preview that will render your app content via new Preview in simple browser added in sprint 1, or via markdown.showPreview if there is no custom emd content in the loaded .md doc.
- How do we detect "custom emd content"?
- Is there a particular reason to offer the markdown.showPreview option? If I am working on an evidence project, I think I would always want to see the preview in a browser.
from evidence-vscode.
@mcrascal even the template Evidence project has README.md
which should show up as Markdown
document not Evidence Markdown
and the built-in markdown.showPreview
command should be available to all .md
files independent of the open project. Current emd
config hides it for all standard .md
docs and needs to be resolved.
from evidence-vscode.
Partial patch for the built-in markdown previews was added in #29.
We should also remove your custom keybdings remapping those built-in commands.
Extensions should not change built-in shortcuts or map built-in commands to new shortcuts. We can only use them as was added in #29.
from evidence-vscode.
The official vscode markdown Preview documentation for more info:
https://code.visualstudio.com/Docs/languages/markdown#_markdown-preview
from evidence-vscode.
Closing this ticket. The missing markdown Outline will be added in #33.
from evidence-vscode.
Related Issues (20)
- Preview window shows up if you kill server before it has finished launch HOT 5
- Ctrl+R startServer keybinding collision with browser refresh in codespaces HOT 3
- Clean Install Walkthrough Flow HOT 1
- Make component props discoverable HOT 1
- Slash command is fired even when focus is outside of current file HOT 1
- Restore default `README.md` and standard `.md` markdown documents handling in VS Code IDE HOT 1
- New Evidence Project option in right-click menu shows up at the top of the list HOT 2
- Evidence: New Evidence Project - does not appear to fetch latest template HOT 1
- VSCode: Remove 'tab target' in SQL code blocks HOT 2
- Display current version of node if incompatible
- Extension does not activate in evidence project HOT 6
- VS Code re-opens the file-select window on top of the error message when trying to create evidence in non empty folder
- Create Templated Page from Query does not work without a link column HOT 2
- Extension is not activitated HOT 6
- Curating of CLI information
- Terminology of commands exposed to users HOT 1
- Setting to prefer external browser rather than simple browser HOT 1
- Remove Create Evidence Project from Template
- Button placement/icon to start/stop server HOT 1
- Automatic server start causes second loading message to appear
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evidence-vscode.