├── requirements.txt ├── assets ├── icon.png └── icon@2x.png ├── Contents └── Info.plist ├── .gitignore ├── octdoc2set.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4==4.5.1 2 | bs4==0.0.1 3 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obstschale/octave-docset/HEAD/assets/icon.png -------------------------------------------------------------------------------- /assets/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obstschale/octave-docset/HEAD/assets/icon@2x.png -------------------------------------------------------------------------------- /Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | octave 7 | CFBundleName 8 | Octave 9 | DocSetPlatformFamily 10 | octave 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | ### OSX ### 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must ends with two \r. 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear on external disk 16 | .Spotlight-V100 17 | .Trashes 18 | 19 | 20 | ### Python ### 21 | # Byte-compiled / optimized / DLL files 22 | __pycache__/ 23 | *.py[cod] 24 | 25 | # C extensions 26 | *.so 27 | 28 | # Distribution / packaging 29 | .Python 30 | env/ 31 | bin/ 32 | build/ 33 | develop-eggs/ 34 | dist/ 35 | eggs/ 36 | lib/ 37 | lib64/ 38 | parts/ 39 | sdist/ 40 | var/ 41 | *.egg-info/ 42 | .installed.cfg 43 | *.egg 44 | 45 | # Installer logs 46 | pip-log.txt 47 | pip-delete-this-directory.txt 48 | 49 | # Unit test / coverage reports 50 | .tox/ 51 | .coverage 52 | .cache 53 | nosetests.xml 54 | coverage.xml 55 | 56 | # Translations 57 | *.mo 58 | 59 | # Mr Developer 60 | .mr.developer.cfg 61 | .project 62 | .pydevproject 63 | 64 | # Rope 65 | .ropeproject 66 | 67 | # Django stuff: 68 | *.log 69 | *.pot 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | Contents/Resources 75 | Octave.tgz 76 | Octave.docset -------------------------------------------------------------------------------- /octdoc2set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, re, sqlite3 4 | from bs4 import BeautifulSoup, NavigableString, Tag 5 | 6 | db = sqlite3.connect('Octave.docset/Contents/Resources/docSet.dsidx') 7 | cur = db.cursor() 8 | 9 | try: cur.execute('DROP TABLE searchIndex;') 10 | except: pass 11 | cur.execute('CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);') 12 | cur.execute('CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);') 13 | 14 | docpath = 'Octave.docset/Contents/Resources/Documents' 15 | 16 | pages = { 17 | "Function": "Function-Index.html", 18 | "Guide": "Concept-Index.html", 19 | "Operator": "Operator-Index.html" 20 | } 21 | 22 | # loop through each index page 23 | for p in pages: 24 | type = p 25 | page = open(os.path.join(docpath, pages[p])).read() 26 | soup = BeautifulSoup(page, 'html.parser') 27 | any = re.compile('.*') 28 | 29 | for td in soup.find_all('td', attrs={"valign": "top"}): 30 | for a in td.find_all('a'): 31 | name = a.text.strip() 32 | if len(name) > 0: 33 | path = a.attrs['href'].strip() 34 | if path.split('#')[0] not in ('index.html', 'biblio.html', 'bookindex.html'): 35 | # check if fct name is already in DB 36 | cur.execute('SELECT * FROM searchIndex WHERE name = ?', (name,) ) 37 | if cur.fetchone() is None: 38 | # if name starts with - it is a command 39 | if name[0] == "-" and len(name) > 3: 40 | temp = type 41 | type = "Command" 42 | 43 | # save fct to DB 44 | cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES (?,?,?)', (name, type, path)) 45 | print('name: %s' % (name)) 46 | print('\ttype: %s' % (type)) 47 | print('\tpath: %s' % (path)) 48 | 49 | # reste type 50 | if name[0] == "-" and len(name) > 3: 51 | type = temp 52 | 53 | 54 | db.commit() 55 | db.close() 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Octave docset 2 | 3 | | Key | Value | 4 | | ----------------------- | ----------------------------------------- | 5 | | Author | Hans-Helge Buerger | 6 | | Current Octave Version: | v6.4.0 | 7 | | Last Update: | 03. November 2021 | 8 | | Twitter | [Twitter](https://twitter.com/obstschale) | 9 | 10 | [Octave](http://www.gnu.org/software/octave/) is a programming language for matrix mathematical calculations. It is very similar to [MatLab](http://www.mathworks.de/products/matlab/) and its syntax is almost interchangable. I use Octave at university for _Machine Learning_ and _Speech Processing_ calculations. 11 | 12 | [Dash](http://kapeli.com/dash) is an API Documentation Browser and Code Snippet Manager for Mac. If you are using Windows or Linux you probably want to have a look at [Zeal](http://zealdocs.org/) which is quite similar to Dash. 13 | 14 | ### Installation for Dash 15 | 16 | Just download this [docset](https://github.com/obstschale/octave-docset/archive/master.zip) and unzip it. To install it just double-click on `Octave.docset` and Dash will add this docset. 17 | 18 | ### Installation for Zeal (Linux or Windows) 19 | 20 | To manually install a docket in Zeal you need to download the [docset](https://github.com/obstschale/octave-docset/archive/master.zip) and copy the docset-folder into `%HOMEPATH%\AppData\zeal\docset\`. Restart Zeal and Octave should be loaded automatically. 21 | 22 | --- 23 | 24 | ### Generate docset 25 | 26 | The docset is generated with a [Python script](https://github.com/obstschale/octave-docset/blob/master/octdoc2set.py) and the [original HTML documentation](http://www.gnu.org/software/octave/support.html). To generate the docset simply clone the repository and you have to change the version variable in `build.sh` (check the link whether the doc version really exists). Then run `./build.sh`. The script will download the docs and will create an `Octave.tgz` file, which is ready for a pull request for [Kapeli/Dash-User-Contributions](https://github.com/Kapeli/Dash-User-Contributions). 27 | 28 | ### Requirements 29 | 30 | ``` 31 | sqlite3==3.8.x 32 | beautifulsoup4==4.5.1 33 | bs4==0.0.1 34 | ``` 35 | 36 | ### Report Bugs 37 | 38 | Please report all bugs or issues to the original repo > [Repo Issues](https://github.com/obstschale/octave-docset/issues) 39 | --------------------------------------------------------------------------------