1609923933
Just because we are working with numbers and code doesn’t mean we need to have a boring Jupyter notebook. In this blog we will go over different ways to spice up your notebook and make it visually pleasing for your readers. Ready? Let’s get started.
#markdown #jupyter-notebook #data-science #data-analytics #python
1609923933
Just because we are working with numbers and code doesn’t mean we need to have a boring Jupyter notebook. In this blog we will go over different ways to spice up your notebook and make it visually pleasing for your readers. Ready? Let’s get started.
#markdown #jupyter-notebook #data-science #data-analytics #python
1603119600
You can put comments in your Jupyter Notebook code to help the reader to understand what you are up to. But longer commentary is better in text cells separate from the code.
Text cells in Jupyter support the Markdown language and we are going to take a look at the facilities that it offers. Markdown is a set of simple markup codes that are easily transformed into HTML for rendering in a browser. Markdown is nowhere near as sophisticated, or complex, as HTML but is perfectly adequate for documenting a notebook (although can also embed HTML if you need more control over the look or layout).
This article was initially written in Markdown (there is a link to the original at the end of this article) and the first paragraph and the two headings looks like this:
## Jupyter and Markdown
### Making your Notebooks look good
Whether you are sharing your Jupyter Notebooks with friends and colleagues or publishing them more widely, they will be better appreciated if they are well layed out and formatted.
Very simple. The ## precedes a heading equivalent to
So the following Markdown code will display a list of headings gradually reducing in size.
## heading 1
### heading 2
#### heading 3
##### heading 4
###### heading 5
####### heading 6
Image by Author
Markdown supports the most common styling such as bold and italic, you can construct lists both numbered and unnumbered. You can embed code within a paragraph or display a complete code block. Hyperlinks are included and you can insert images, too. Tables can be constructed with left and right justified columns with very simple syntax.
Markdown ignores single line breaks, so to separate paragraphs, you need to insert two line breaks.
Below we are going to go through some examples of the Markdown code. For each example I’ll show you the Markdown code and then follow it with the way that it will look after being rendered.
#programming #data-science #jupyter-notebook #markdown
1672956300
A Markdown renderer for Vapor and Leaf. This uses the Vapor Markdown package to wrap cmark (though a fork is used to make it work with Swift PM), so it understands Common Mark. A quick reference guide for Common Mark can be found here. It also supports Github Flavored Markdown.
Once set up, you can use it in your Leaf template files like any other tag:
#markdown(myMarkdown)
Where you have passed myMarkdown
into the view as something like:
# Hey #
Check out my *awesome* markdown! It is easy to use in `tags`
Add Leaf Markdown as a dependency in your Package.swift
file:
dependencies: [
...,
.package(name: "LeafMarkdown", url: "https://github.com/vapor-community/leaf-markdown.git", .upToNextMajor(from: "3.0.0")),
]
Then add the dependency to your target:
.target(
name: "App",
dependencies: [
// ...
"LeafMarkdown"
],
// ...
)
Register the tag with Leaf so Leaf knows about it:
app.leaf.tags["markdown"] = Markdown()
Don't forget to import LeafMarkdown in the file you register the tag with import LeafMarkdown
.
Author: Vapor-community
Source Code: https://github.com/vapor-community/leaf-markdown
License: MIT license
1596458160
Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown. Mostly, Markdown is just regular text with a few non-alphabetic characters thrown in, like # or *.
Markdown is very popular to write README’s on Github. So, I’ve given you a tutorial of the markdown.
You can find documantation and a complete explanation of Markdown’s syntex here.
You can create headings by prefixing with a #
(hash mark).
Syntex:
# Heading 1
or
=====
Syntex:
## Heading 2
or
----
Syntex:
### Heading 3
Syntex:
#### Heading 4
Syntex:
##### Heading 5
Syntex:
###### Heading 6
You can make any text bold by adding double asterisks (*) or double underscores(_).
Syntex:
**Bold**
__Bold__
You can make any text italic by adding asterisk (*) or underscore(_).
Syntex:
*Italic*
_Italic_
Even you can combine both them.
Syntex:
You **can** combine them_
Markdown supports strikethrough by wrapping text in ~~
:
Syntex:
~~This text is strikethrough.~~
#markdown #readme #learning #programming #beginners-guide #deep learning
1645245233
Mermaid was nominated and won the JS Open Source Awards (2019) in the category "The most exciting use of technology"!!!
Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
Doc-Rot is a Catch-22 that Mermaid helps to solve.
Diagramming and documentation costs precious developer time and gets outdated quickly. But not having diagrams or docs ruins productivity and hurts organizational learning.
Mermaid addresses this problem by cutting the time, effort and tooling that is required to create modifiable diagrams and charts, for smarter and more reusable content. The text definitions for Mermaid diagrams allows for it to be updated easily, it can also be made part of production scripts (and other pieces of code). So less time needs to be spent on documenting, as a separate and laborious task.
Even non-programmers can create diagrams through the Mermaid Live Editor.
Tutorials has video tutorials. Use Mermaid with your favorite applications, check out the list of Integrations and Usages of Mermaid.
The following are some examples of the diagrams, charts and graphs that can be made using Mermaid and the Markdown-inspired text specific to it. Click here jump into the text syntax.
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
classDiagram
Class01 <|-- AveryLongClass : Cool
<<Interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<<service>>
int id
size()
}
classDiagram
Class01 <|-- AveryLongClass : Cool
<<Interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<<service>>
int id
size()
}
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
pie
"Dogs" : 386
"Cats" : 85
"Rats" : 15
pie
"Dogs" : 386
"Cats" : 85
"Rats" : 15
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
Mermaid is a growing community and is always accepting new contributors. There's a lot of different ways to help out and we're always looking for extra hands! Look at this issue if you want to know where to start helping out.
Detailed information about how to contribute can be found in the contribution guide
For public sites, it can be precarious to retrieve text from users on the internet, storing that content for presentation in a browser at a later stage. The reason is that the user content can contain embedded malicious scripts that will run when the data is presented. For Mermaid this is a risk, specially as mermaid diagrams contain many characters that are used in html which makes the standard sanitation unusable as it also breaks the diagrams. We still make an effort to sanitise the incoming code and keep refining the process but it is hard to guarantee that there are no loop holes.
As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing javascript in the code from being executed. This is a great step forward for better security.
Unfortunately you can not have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code.
To report a vulnerability, please e-mail security@mermaid.live with a description of the issue, the steps you took to create the issue, affected versions, and if known, mitigations for the issue.
A quick note from Knut Sveidqvist:
Many thanks to the d3 and dagre-d3 projects for providing the graphical layout and drawing libraries! Thanks also to the js-sequence-diagram project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering. Thank you to Tyler Long who has been a collaborator since April 2017.
Thank you to the ever-growing list of contributors that brought the project this far!
Mermaid was created by Knut Sveidqvist for easier documentation.
English | 简体中文
For a more detailed introduction to Mermaid and some of its more basic uses, look to the Beginner's Guide and Usage.
🌐 CDN | 📖 Documentation | 🙌 Contribution | 📜 Changelog
Download Details:
Author: mermaid-js
Source Code: https://github.com/mermaid-js/mermaid
License: MIT
#markdown #markdown #flowchart #javascript