Skip to content

Commit 6d988c4

Browse files
committed
inital scetch for indexing all examples
1 parent 67916dc commit 6d988c4

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
index.js
2+
octave/octave-workspace
13
cmdline.term
24
sage-plots-for*.tex
35
*.sout

index.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
# coding: utf8
3+
4+
'''
5+
This creates an index file `index.js` such that SageMathCloud (https://cloud.sagemath.com)
6+
knows about each relevant file, information in it, etc.
7+
8+
The format of `index.js` is standard JSON, such that a node.js process can read it easily.
9+
'''
10+
11+
from json import dump
12+
from codecs import open
13+
from glob import glob
14+
from os.path import isdir
15+
16+
index = []
17+
18+
for fn in glob("*"):
19+
if isdir(fn):
20+
index.append(fn)
21+
22+
with open("index.js", "w", "utf8") as out:
23+
dump(index, out)
24+

makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.PHONY = index
2+
3+
index:
4+
@echo "indexing examples for SMC"
5+
./index.py
6+

0 commit comments

Comments
 (0)