Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ trame-code |pypi_download|

Widget for Monaco VS code editor for trame

The editor can surface language features (autocomplete and hover
documentation) from your own server-side callbacks: pass ``completion``
and ``hover`` callables to the widget. The example below shows Python/VTK
completion and a hover docstring driven entirely from those callbacks.

.. image:: https://raw.githubusercontent.com/Kitware/trame-code/master/docs/completion-hover.png
:alt: Monaco editor showing Python/VTK completion and a hover docstring
:align: center


License
-----------------------------------------------------------
Expand Down
Binary file added docs/completion-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/trame_code/module/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
from pathlib import Path

from trame_code import __version__

# Compute local path to serve
serve_path = str(Path(__file__).with_name("serve").resolve())

# Version the served directory so a client re-fetches JS/CSS after an upgrade
# instead of getting a stale bundle from the browser cache.
serve_directory = f"__trame_code_{__version__}"

# Serve directory for JS/CSS files
serve = {"__trame_code": serve_path}
serve = {serve_directory: serve_path}

# List of JS files to load (usually from the serve path above)
scripts = ["__trame_code/trame-code.umd.js"]
scripts = [f"{serve_directory}/trame-code.umd.js"]

# List of CSS files to load (usually from the serve path above)
styles = ["__trame_code/style.css"]
styles = [f"{serve_directory}/style.css"]

# List of Vue plugins to install/load
vue_use = ["trame_code"]
Expand Down
Loading