Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -529,9 +529,35 @@ with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_gen
|
|
529 |
link_azure = gr.Textbox(placeholder="Masukkan Endpoint Azure", label="Azure Endpoint", info = "Abaikan Kolom Ini Jika Anda Menggunakan Skema Openai")
|
530 |
replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
531 |
button_scrap = gr.Button("Scrap Article")
|
532 |
-
wysiwyg_editor_judul = gr.HTML(""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
img = gr.Image()
|
534 |
-
wysiwyg_editor = gr.HTML(""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
536 |
with gr.Column():
|
537 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|
|
|
529 |
link_azure = gr.Textbox(placeholder="Masukkan Endpoint Azure", label="Azure Endpoint", info = "Abaikan Kolom Ini Jika Anda Menggunakan Skema Openai")
|
530 |
replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
531 |
button_scrap = gr.Button("Scrap Article")
|
532 |
+
wysiwyg_editor_judul = gr.HTML("""
|
533 |
+
<label for="wysiwyg-editor">Article</label>
|
534 |
+
<textarea id="wysiwyg-editor" style="height: 100px; width: 50%;"></textarea>
|
535 |
+
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>
|
536 |
+
<script>
|
537 |
+
tinymce.init({
|
538 |
+
selector: '#wysiwyg-editor',
|
539 |
+
plugins: 'lists advlist autolink link image charmap print preview hr anchor pagebreak',
|
540 |
+
toolbar: 'undo redo | bold italic underline | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
|
541 |
+
menubar: false,
|
542 |
+
content_style: 'body { background-color: #143; color: #fff; }'
|
543 |
+
});
|
544 |
+
</script>
|
545 |
+
""")
|
546 |
img = gr.Image()
|
547 |
+
wysiwyg_editor = gr.HTML("""
|
548 |
+
<label for="wysiwyg-editor">Article</label>
|
549 |
+
<textarea id="wysiwyg-editor" style="height: 300px; width: 50%;"></textarea>
|
550 |
+
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>
|
551 |
+
<script>
|
552 |
+
tinymce.init({
|
553 |
+
selector: '#wysiwyg-editor',
|
554 |
+
plugins: 'lists advlist autolink link image charmap print preview hr anchor pagebreak',
|
555 |
+
toolbar: 'undo redo | bold italic underline | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
|
556 |
+
menubar: false,
|
557 |
+
content_style: 'body { background-color: #143; color: #fff; }'
|
558 |
+
});
|
559 |
+
</script>
|
560 |
+
""")
|
561 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
562 |
with gr.Column():
|
563 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|