diff --git a/CHANGELOG.md b/CHANGELOG.md index b28203a..86acefd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Pre-release] -(TODO) +## 2.2 Last Python2 version! - Introduce ``#short`` to make it shorter 190719 - ## 2.1 ### Added - Insert files (drag and drop) from Apple Photos diff --git a/docs/requirements.txt b/docs/requirements.txt index 7778029..4364256 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,3 +3,4 @@ markdown==2.6.11 py-gfm==0.1.3 Flask pandas +pygments diff --git a/docs/source/getstarted.rst b/docs/source/getstarted.rst index c54467f..938e5dc 100644 --- a/docs/source/getstarted.rst +++ b/docs/source/getstarted.rst @@ -29,5 +29,3 @@ open your browser and copy-paste the ```html path``` (in my case is ```file:///p To make a new note, create a file in ```/notes/```. Remember to keep geekbookapp.py running all the time, it will detect a new note and compile it for you. - -**To force your browser to refresh html files whenevery there is a change on you drive (when geekbook compiles something new) please use something like this Auto-load (https://addons.mozilla.org/en-US/firefox/addon/auto-reload/?src=api) (this works for me in Firefox).** diff --git a/docs/source/quickref.rst b/docs/source/quickref.rst index bf5fb86..319765d 100644 --- a/docs/source/quickref.rst +++ b/docs/source/quickref.rst @@ -3,21 +3,39 @@ Quick Reference :: + find a full path to your file and insert it in the given place in a generated html [ff:] [ff:uniq-name.pse] - find a full path to your file and insert it in the given place in a generated html - -:: + insert an external file [if:] [if:/Users/magnus/work-src/fenzymes/examples/readme.txt] - insert an external file -:: + insert the table of content in here + [tableofcontent] or {{TOC}} + + to get the current date 2017-01-13 + [date] + + define only width for a image: + ![](imgs/Screen_Shot_2017-02-12_at_1.17.04_AM.png =500x) + + only height: + ![](imgs/Screen_Shot_2017-02-12_at_1.17.04_AM.png =x400) + + and both: + ![](imgs/Screen_Shot_2017-02-12_at_1.17.04_AM.png =400x400) + + you can put to images next to each other and sqeeze them to the left +
+ ![](imgs/190409_L4yjm119T5aONVO9BVeCTQ_thumb_7a17.jpg)![](imgs/190409_thumb_7a18.jpg) +
+ + #short - set for image (``max-height:400px``) to make it shorter [tableofcontent] or {{TOC}} insert the table of content in here -Images:: - #short - set for image (``max-height:400px``) to make it shorter + add description of a note in the Index page + [desc:info on TN] diff --git a/docs/source/rna.rst b/docs/source/rna.rst index 757b1ec..d522665 100644 --- a/docs/source/rna.rst +++ b/docs/source/rna.rst @@ -1,7 +1,7 @@ -RNA-pdb-tools +mmagnus/rna-tools ============================================================ -You need to install rna-pdb-tools (http://rna-pdb-tools.readthedocs.io/en/latest/) first. +You need to install rna-tools (http://rna-tools.readthedocs.io/en/latest/) first. Draw VARNA-based image of RNA secondary structure ------------------------------------------------------------ diff --git a/docs/source/view.rst b/docs/source/view.rst index 0933f9b..749dbe2 100644 --- a/docs/source/view.rst +++ b/docs/source/view.rst @@ -4,18 +4,4 @@ Out | Read .. image:: ../imgs/view.png **Fig**. The index in Safari. -Of course you can browser your notes in any browser. I'm using (mmagnus) Firefox with following addons to improve the experience, and Safari for screenshots ;-) - -Auto-reload --------------------------------------------------------------- - -To force your browser to refresh HTML files whenever there is a change on you drive (when geekbook compiles something new) please use something like this Auto-load (https://addons.mozilla.org/en-US/firefox/addon/auto-reload/?src=api) - -Old default image style --------------------------------------------------------------- - -To get "old default image style" (white background) in Firefox install this add-on (https://addons.mozilla.org/en-US/firefox/addon/old-default-image-style/) - -.. image:: ../imgs/firefox_img_old.png - - +Of course you can browser your notes in any browser. I used to use Firefox, then Chrome, and now Safari :-) diff --git a/engine/conf.py b/engine/conf.py index 64b0651..9613d4e 100644 --- a/engine/conf.py +++ b/engine/conf.py @@ -18,7 +18,6 @@ SCREENSHOT_INBOX = None - # find files plugin off/on FIND_FILES_PLUGIN = False diff --git a/engine/plugins/find_files.py b/engine/plugins/find_files.py index ae02eda..5076840 100755 --- a/engine/plugins/find_files.py +++ b/engine/plugins/find_files.py @@ -17,60 +17,6 @@ JSON_DB = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'find_file.json' -## def file_search(filename, verbose): -## """Search for filename. Returns dirname of the filename's path, and the full path. - -## 181120 Test on my OSX. I might work on Linux as well. But this requires further -## testing. - -## 170107 add cache. If the db is not found, create an empty pandas df -## and populate this df with append later. If the filename is not in the db -## run g/locate. Then, save the found path to the db (using pandas, via df, to json)""" -## import pandas as pd -## # cache -## if os.path.isfile(JSON_DB): -## df = pd.read_json(JSON_DB, orient='records') -## #filename = 'x.pse' -## pathdf = df[df['fn'] == filename]['path'] -## # test if the file still exists there -## path = pathdf.to_string(index=False) -## if not pathdf.empty and os.path.isfile(path): -## logger.info('[from the db]:' + filename) -## return os.path.dirname(path), path -## # ok, here the function will finished if the results were cashed and -## # file still exists there -## else: -## df = pd.DataFrame() - -## # if filename is not found in the db -## logger.info('find file:' + filename) - -## if platform.system() == "Linux": -## out = commands.getoutput('locate ' + filename) -## if platform.system() == "Darwin": -## # out = commands.getoutput('glocate ' + filename) -## out = commands.getoutput('mdfind -name ' + filename) -## first_hit = out.split('\n')[0] -## logger.info('# of hits ' + str(len(out.split('\n'))) + " " + out.replace('\n',', ')) -## if not first_hit: -## logger.info('not found') -## return ('Not found', '~~' + filename + '~~') -## else: -## logger.info('hit ' + first_hit) - -## # update cache -## dffile = pd.DataFrame([[filename, first_hit],], columns=['fn', 'path']) -## if verbose: print(df) -## try: -## df[df['fn'] == filename]['path'] -## except KeyError: -## pass -## df = df.append(dffile, ignore_index=True) -## # save to json -## df.to_json(JSON_DB, orient='records') -## return os.path.dirname(first_hit), first_hit - - def find_files(text, verbose=False): """ The search was completely re-written in a way that now the files @@ -92,7 +38,7 @@ def find_files(text, verbose=False): if verbose: print '# file_finder.search()', output # remove for now folder link, it does not work @todo #output += l.replace('[ff:' + filename + ']',' [+] ' + ' ' + os.path.basename(filepath) + '') - output += l.replace('[ff:' + filename + ']', ' ' + os.path.basename(filepath) + '\n') + output += l.replace('[ff:' + filename + ']', ' ' + os.path.basename(filepath) + '\n') # or without '\n else: output += l + '\n' output = output.replace('[files-not-found]', msg_listofnotfoundfiles) diff --git a/engine/webserverflask.py b/engine/webserverflask.py index 313b4f1..60e4524 100644 --- a/engine/webserverflask.py +++ b/engine/webserverflask.py @@ -142,7 +142,6 @@ def view(note_title): """Open a note with your edit http://flask.pocoo.org/snippets/76/ """ - print(note_title) if request.remote_addr not in ['127.0.0.1', '0.0.0.0']: if note_title not in OPEN_ACCESS: return 'Hmm...'