LoginSignup
2
2

More than 5 years have passed since last update.

kivyのreStructuredText rendererを試してみた

Last updated at Posted at 2016-07-02

やったこと

KivyでRSTをレンダリングできるらしいので試してみた。

ソースコード

試すだけなので簡単に実装

main.py
import kivy
from kivy.uix.widget import Widget
from kivy.app import App

class textImput(Widget):
    def Text(self):
        pass

class editorApp(App):
    def build(self):
        return textImput()

editorApp().run()

KVは以下の通り

editor.kv
<textImput>:
    BoxLayout:
        orientation: 'vertical'
        size: 800, 600
        TextInput:
            id: txt_inpt
            size_hint: 1, 5
            text: ''        
        RstDocument:
            text: txt_inpt.text
            size_hint: 1, 5
            show_errors: True     

実行結果

rst.PNG

画像はGetting StartedのRSTをとりあえず貼ってみた結果です。上がRST、下が結果。
レンダリングできているようです。
これは。多分、便利。

以上
試してみたでした。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2