SimonBiggs / scriptedforms

Quickly create live-update GUIs for Python packages using Markdown and simple HTML elements.
Apache License 2.0
508 stars 34 forks source link

Remove margin before output area. Make Markdown font be Roboto within output area. #185

Closed robmarkcole closed 6 years ago

robmarkcole commented 6 years ago

My apologies if this is documented already, I didn't find it.

I have a python variable (path_to_watch = os.path.join(os.getcwd(), 'test_folder') )which I wish to display within a body of Markdown text - is this possible? I was hoping to do the following:

# Folder monitor
Watching folder Markdown(path_to_watch) for changes.
SimonBiggs commented 6 years ago

First thing you're probably best off using path_to_watch = os.path.abspath('test_folder').

As long as the following code has been run from IPython.display import display, Markdown then you will be able to run the following:

markdown_string = "Watching folder {} for changes.".format(path_to_watch)
display(Markdown(markdown_string))
robmarkcole commented 6 years ago

Thanks @SimonBiggs that puts the string in the python section (below), but it's not possible to put the string in the Markdown section?

image

SimonBiggs commented 6 years ago

The indent can be removed and the font can be the same? I was considering doing that anyway...

Would that achieve what you're after?

SimonBiggs commented 6 years ago

Actually there is a way... Your could write the following in line with your other text:

<code class="language-python">display(Markdown(your_variable))</code>

I'm not sure how it would style though.

SimonBiggs commented 6 years ago

Also, would something like the following be a way to solve your issue?

https://github.com/SimonBiggs/scriptedforms/issues/196

SimonBiggs commented 6 years ago

Hi @robmarkcole

I have removed the margin in the dev version with https://github.com/SimonBiggs/scriptedforms/commit/aed35b2fb40f81994f60407cfc5cf7225977e77c

Let me know if that solves this issue.