Skip to content

Commit

Permalink
docs(transflow): replace transfunc.js with transflow.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 12, 2021
1 parent 02b3439 commit 420ee7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
26 changes: 0 additions & 26 deletions examples/_quake/transfuncs.js
Original file line number Diff line number Diff line change
@@ -1,26 +0,0 @@
function from_todo_blog_to_quake_calendar(todos, blogs) {
let results = [];
for (let todo of todos) {
results.push({
type: "todo",
id: todo.id,
title: todo.title,
content: todo.content,
created_date: todo.created_date,
updated_date: todo.updated_date
})
}

for (let blog of blogs) {
results.push({
type: "blog",
id: blog.id,
title: blog.title,
content: blog.description,
created_date: blog.created_date,
created_date: blog.updated_date
})
}

return results;
}
4 changes: 1 addition & 3 deletions quake_webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
<body>
<div id="navigator">
<a href="/">Go Home</a>
<div id="transflow-nav">
<a href="/transflow/show_calendar">calendar</a>
</div>
<div id="transflow-nav"></div>
</div>
<div id="outlet"></div>
</body>
Expand Down
5 changes: 4 additions & 1 deletion src/server/transflow_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ pub(crate) async fn translate(
Ok(JavaScript(scripts))
}

/// saved transflow scripts
/// todo: load transflow from yaml files
/// 1. load yaml file with define
/// 2. generate js scripts
/// 3. create router
#[get("/script")]
pub(crate) async fn transfunc_script(config: &State<QuakeConfig>) -> Option<NamedFile> {
let path = PathBuf::from(config.workspace.clone());
Expand Down

0 comments on commit 420ee7b

Please sign in to comment.