yoinked commited on
Commit
be6e01f
·
verified ·
1 Parent(s): 253a0d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -147,7 +147,6 @@ paperid: {paperid}
147
  raw = metadata + data
148
  f.write(raw)
149
  def makepreview(x):
150
- print(x)
151
  return x
152
  with gr.Blocks(css=basecss, js=jscode, theme='NoCrypt/miku') as demo:
153
  with gr.Tab("search"):
@@ -155,13 +154,13 @@ with gr.Blocks(css=basecss, js=jscode, theme='NoCrypt/miku') as demo:
155
  query = gr.Textbox(label="tags (optional, comma seperated)", lines=1, interactive=True)
156
  searchbutton = gr.Button("search")
157
  with gr.Row():
158
- papercards = gr.HTML("")
159
  with gr.Tab("read"):
160
  with gr.Row():
161
  paperid = gr.Textbox(label="paper id", lines=1, interactive=True)
162
  readbutton = gr.Button("read")
163
  with gr.Row():
164
- paper = gr.Markdown("")
165
  with gr.Tab("publish"):
166
  with gr.Row():
167
  title = gr.Textbox(label="title", lines=1, interactive=True)
@@ -170,14 +169,11 @@ with gr.Blocks(css=basecss, js=jscode, theme='NoCrypt/miku') as demo:
170
  tags = gr.Textbox(label="tags (optional, comma seperated)", lines=1, interactive=True)
171
  abst = gr.Textbox(label="abriged abstract (aka tooltip)", lines=2, interactive=True)
172
  markd = gr.Textbox(label="markdown", lines=10, interactive=True, max_lines=1e3)
173
- with gr.Accordion("preview"):
174
-
175
- previewbutton = gr.Button("preview")
176
- preview = gr.Markdown("")
177
  with gr.Row():
178
  status = gr.Textbox(label="status", lines=1, interactive=False)
179
  publishbutton = gr.Button("publish")
180
- previewbutton.click(fn=makepreview, inputs=markd, outputs=preview)
181
  publishbutton.click(fn=publish_paper, inputs=[title, authors, tags, abst, markd], outputs=status)
182
  searchbutton.click(fn=make_paper_cards, inputs=query, outputs=papercards)
183
  readbutton.click(fn=get_paper_markdown, inputs=paperid, outputs=paper)
 
147
  raw = metadata + data
148
  f.write(raw)
149
  def makepreview(x):
 
150
  return x
151
  with gr.Blocks(css=basecss, js=jscode, theme='NoCrypt/miku') as demo:
152
  with gr.Tab("search"):
 
154
  query = gr.Textbox(label="tags (optional, comma seperated)", lines=1, interactive=True)
155
  searchbutton = gr.Button("search")
156
  with gr.Row():
157
+ papercards = gr.HTML()
158
  with gr.Tab("read"):
159
  with gr.Row():
160
  paperid = gr.Textbox(label="paper id", lines=1, interactive=True)
161
  readbutton = gr.Button("read")
162
  with gr.Row():
163
+ paper = gr.Markdown()
164
  with gr.Tab("publish"):
165
  with gr.Row():
166
  title = gr.Textbox(label="title", lines=1, interactive=True)
 
169
  tags = gr.Textbox(label="tags (optional, comma seperated)", lines=1, interactive=True)
170
  abst = gr.Textbox(label="abriged abstract (aka tooltip)", lines=2, interactive=True)
171
  markd = gr.Textbox(label="markdown", lines=10, interactive=True, max_lines=1e3)
172
+ preview = gr.Markdown()
 
 
 
173
  with gr.Row():
174
  status = gr.Textbox(label="status", lines=1, interactive=False)
175
  publishbutton = gr.Button("publish")
176
+ markd.change(fn=makepreview, inputs=markd, outputs=preview)
177
  publishbutton.click(fn=publish_paper, inputs=[title, authors, tags, abst, markd], outputs=status)
178
  searchbutton.click(fn=make_paper_cards, inputs=query, outputs=papercards)
179
  readbutton.click(fn=get_paper_markdown, inputs=paperid, outputs=paper)