Skip to content

Commit

Permalink
Support for Stata
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaem authored and mwouts committed Feb 20, 2023
1 parent d1171c3 commit ef2a3b1
Show file tree
Hide file tree
Showing 9 changed files with 647 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Jupytext works with notebooks in any of the following languages:
- Scala
- Scheme
- Script of Script
- Stata
- TypeScript
- Haskell
- Tcl
Expand Down
1 change: 1 addition & 0 deletions jupytext/languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"comment_suffix": "*/",
}, # Maxima only has block comments
".gp": {"language": "gnuplot", "comment": "#"},
".do": {"language": "stata", "comment": "//"},
}

_COMMENT_CHARS = [
Expand Down
522 changes: 522 additions & 0 deletions tests/notebooks/ipynb_stata/stata_notebook.ipynb

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions tests/notebooks/mirror/ipynb_to_Rmd/stata_notebook.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
jupyter:
kernelspec:
display_name: Stata
language: stata
name: stata
---

```{stata}
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel
```

```{stata}
use http://www.stata-press.com/data/r13/auto
```

```{stata}
summarize
```

```{stata}
scatter weight length
```
19 changes: 19 additions & 0 deletions tests/notebooks/mirror/ipynb_to_hydrogen/stata_notebook.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ---
// jupyter:
// kernelspec:
// display_name: Stata
// language: stata
// name: stata
// ---

// %%
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel

// %%
use http://www.stata-press.com/data/r13/auto

// %%
summarize

// %%
scatter weight length
23 changes: 23 additions & 0 deletions tests/notebooks/mirror/ipynb_to_md/stata_notebook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
jupyter:
kernelspec:
display_name: Stata
language: stata
name: stata
---

```stata
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel
```

```stata
use http://www.stata-press.com/data/r13/auto
```

```stata
summarize
```

```stata
scatter weight length
```
22 changes: 22 additions & 0 deletions tests/notebooks/mirror/ipynb_to_myst/stata_notebook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
kernelspec:
display_name: Stata
language: stata
name: stata
---

```{code-cell}
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel
```

```{code-cell}
use http://www.stata-press.com/data/r13/auto
```

```{code-cell}
summarize
```

```{code-cell}
scatter weight length
```
19 changes: 19 additions & 0 deletions tests/notebooks/mirror/ipynb_to_percent/stata_notebook.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ---
// jupyter:
// kernelspec:
// display_name: Stata
// language: stata
// name: stata
// ---

// %%
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel

// %%
use http://www.stata-press.com/data/r13/auto

// %%
summarize

// %%
scatter weight length
17 changes: 17 additions & 0 deletions tests/notebooks/mirror/ipynb_to_script/stata_notebook.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ---
// jupyter:
// kernelspec:
// display_name: Stata
// language: stata
// name: stata
// ---

// +
// This notebook uses the stata_kernel: https://github.com/kylebarron/stata_kernel
// -

use http://www.stata-press.com/data/r13/auto

summarize

scatter weight length

0 comments on commit ef2a3b1

Please sign in to comment.