kosukemizuno / esapy Goto Github PK
View Code? Open in Web Editor NEWA python implementation of esa.io API
License: MIT License
A python implementation of esa.io API
License: MIT License
[--destructive] | --no-output | --output=<filename>
--force-upload
フラグ
--force-new-post
フラグ
--edit-in-browser | --no-browser
--name
--category
--message
--tag
[--wip | --no-wip]
[--token <esa.io_token>]
[--team <esa.io_team_name>]
[--proxy :]
[--verbose]
アップロード時にpost_numberが存在したら既存の記事を上書きするが、ipynbファイルをexplorer上でコピーして新しいnotebookにした場合を検出して、新しい記事として投稿するようにしたい。
ただし、アップ後にファイル名を変える場合もあるので、強制で新しい記事にするのではなく尋ねる(or 実行時引数で指定)という形にしたい
post_number だけじゃなく、ファイル名(親ディレクトリを含まない)でsha256 hashを記録しておく
Uploading images attached to a cell.
Command Ctrl+V
on jupyter embed a clipboard image on a cell. The conversion process to markdown via nbconvert doesn't extract these attached images.
png前提のコードになってるので要修正
Lines 648 to 685 in b0c67f7
windows10限定(その他のOSはどうする?)
エクスプローラの右クリックからファイルをesa.ioのアップローダに送れるようにする
コマンドは esa register-sendto <type>
とか
esa unregister-sendto [<type> | --all]
とかも欲しい
markdown内のinline math がmathjaxと競合しないようにする
アンダースコアをエスケープする
バックスラッシュ+記号のコマンドをエスケープする(\,
, \
, \!
)
patch時のpost_infoとして、過去の記録ではなくて、GETして現在の情報を集めるようにしたい
GETして記事が存在しなかったら、newpostとして作成する
mdファイルをアップするときに、記事作成に成功したのにエラーが出る
[2020-06-13 15:41:07,664] esapy.processor INFO: Intermediate markdown file has been saved.
[2020-06-13 15:41:07,665] esapy.entrypoint INFO: publish mode=force, result of preprocess=True, ... pu
blish: True
[2020-06-13 15:41:07,665] esapy.processor INFO: Uploading markdown body ...
[2020-06-13 15:41:07,669] esapy.processor INFO: Gathering information for create post
[2020-06-13 15:41:07,670] esapy.processor INFO: This file has not been uploaded before. ==> create new
post
[2020-06-13 15:41:07,670] esapy.api INFO: Creating new post
[2020-06-13 15:41:08,308] esapy.api INFO: New post was successfully created.
[2020-06-13 15:41:08,309] esapy.api INFO: URL of the created post: https://dia-pe-titech.esa.io/posts/
590
[2020-06-13 15:41:08,311] esapy.processor INFO: Removing temporal working directory
Traceback (most recent call last):
File "/home/mizuno/.pyenv/versions/3.7.7/bin/esa", line 8, in <module>
sys.exit(main())
File "/home/mizuno/.pyenv/versions/3.7.7/lib/python3.7/site-packages/esapy/entrypoint.py", line 183,
in main
args.handler(args)
File "/home/mizuno/.pyenv/versions/3.7.7/lib/python3.7/site-packages/esapy/entrypoint.py", line 57,
in command_up
post_url = proc.upload_body()
File "/home/mizuno/.pyenv/versions/3.7.7/lib/python3.7/site-packages/esapy/processor.py", line 296,
in upload_body
self.nbjson
AttributeError: 'MarkdownProcessor' object has no attribute 'nbjson'
This way can separate
and they make able to
</summary>
の後と、</details>
の前の無駄な空白行が追加されてしまうのが気になる。
例↓
<details open>
<summary>[32]: code source</summary>
` ` `python
import numpy as np
def calc_theta(MFD, f):
return MFD/f * 180/np.pi
# For test
print(f"test: {calc_theta(3.5e-6, 4.0e-3)} deg")
` ` `
</details>
Currently, if puslish fails, it cannot be caught.
The esa.io provides us <details> ... </details>
tag.
Sometimes python code and result are too long to look roughly.
If code-block or result-block is longer than --fold-line-num
, they should be enclosed with <details> ... </details>
tag in the final markdown.
WSLからブラウザを開くせいか? 標準出力が消滅する 入力したコマンドも消える
if figure caption includes reference (e.g. cross-ref), image tag in markdown is ignored in replace stage.
post_info に記事の本体をいれとくとjupyterlabの拡張機能でmetadataを調べるとき邪魔
使ってないし除去してもよいだろう
Currently, even if once upload was succeeded, there is no record. Notebook files can store optional data as metadata. If an upload-experienced ipynb file is assigned for esa-up, it should update the post rather than create a new post.
現在はUntitledでアップロード → 手動でタイトル・記事変更としていて手間である
例えばマジックコマンドで指定できるようにする。
@esapy_title sugoi_taitoru
もしくは、1セル目1行目の1st class headerをタイトル扱いにする
どちらの場合も生成される記事には残らないようにしたい
esa -v
や単にesa
などと実行時にサブコマンドを指定しない場合、次のようなエラーが発生した。
Traceback (most recent call last):
File "c:\users\__username__\.conda\envs\qudi\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\__username__\.conda\envs\qudi\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\__username__\.conda\envs\qudi\Scripts\esa.exe\__main__.py", line 7, in <module>
File "c:\users\__username__\.conda\envs\qudi\lib\site-packages\esapy\entrypoint.py", line 189, in main
args.handler(args)
AttributeError: 'Namespace' object has no attribute 'handler'
Preference:
.esapyrc
file doesn't exist,Current:
.esapyrc
file doesn't exist,A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.