-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
filters: | ||
- gradio | ||
--- | ||
|
||
```{python} | ||
import gradio as gr | ||
def greet(name): | ||
return f"Hello {name}!" | ||
demo = gr.Interface( | ||
fn=greet, | ||
inputs="textbox", | ||
outputs="textbox", | ||
live=True | ||
) | ||
demo.launch() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function src_include_shortcode(args, kwargs) | ||
-- Get the file path from the first argument | ||
local file_path = args[1] | ||
if not file_path then | ||
io.stderr:write("Warning: No file path provided to src-include\n") | ||
return pandoc.Null() | ||
end | ||
|
||
-- Read the file contents | ||
local file, err = io.open(file_path, "r") | ||
if not file then | ||
io.stderr:write("Warning: Could not open file: " .. file_path .. (err and (" - " .. err) or "") .. "\n") | ||
return pandoc.Null() | ||
end | ||
|
||
-- Read the entire file content | ||
local content = file:read("*all") | ||
file:close() | ||
|
||
return pandoc.Code(content) | ||
end | ||
|
||
return { | ||
['src-include'] = src_include_shortcode | ||
} |