从同一服务器上的 OfficeLibre Writer 更改实时 HTML 文件

从同一服务器上的 OfficeLibre Writer 更改实时 HTML 文件

I have discussed this issue briefly in ##linux freednode twice over the past few months. Once I got crucified;

WHY WOULD YOU DO THIS!?

and second conversation I wasn't pleased with the results of the discussion so here I am.

What I would like to achieve if I could wave my magic wizard wand successfully:

I want to know if it is possible to load /var/www/domainname/public_html/index.html in OfficeLibre Writer and edit index.html of a working domain on my server, press save and my site updates to the web. Simple. Right...?

I opened /var/www/domainname/public_html/index.html in OfficeLibre Writer made changes to the file went to save, OfficeLibre Writer asked me to overwrite so I did but then got error Error saving the document index: "/var/www/domainname/public_html/index.html was denied.

Then I press Okay and get:

Error saving the document index: General Error.  General input/output error.

I am using CentOS7 as a server and work station.

I can see why CentOS would have an issue from a security point of view. If we can put humans on the moon I believe the result I am seeking is obtainable.


So I ran soffice --writer opened the index.html file, made minor changes, saved and pressed refresh on the browser and yeah the process went through but the result was not what I expected. Result was the code and not the graphical webpage I had before.

mikekaganski from freenode said

I mean that Writer is not intended to be a neat HTML editor preserving its structure; it imports any textual data into its document model (totally unrelated to HTML DOM), and then on export, it makes another conversion from its model into the target format ... and that's expected not to preserve the structure

有道理,我想我想做的是“集成”两个独立的软件,期望它们彼此“同步”。

我确实在 cli 上注意到了这一点

[orca@orcacomputers bin]$ sudo soffice --writer
[sudo] password for orca: 
javaldx: Could not find a Java Runtime Environment!
Warning: failed to read path from javaldx
Gtk-Message: 00:51:56.654: GtkDialog mapped without a transient parent. This is discouraged.

好吧,当然,所以我的好奇心仍然没有得到满足,所以我创建了一个以前不存在的新 test.html 文件,看看我是否可以获得结果,但是我得到了

文件不存在

所以看起来这是不可能的。

我的下一个测试是使用 Atom 是否可以实现这一点。

答案1

你得到的错误可能是因为index.html文件位于root拥有的目录中,尝试使用超级用户权限运行LibreOffice,如果这不起作用,请尝试使用nano或vim编辑文件,如果成功则问题所在与 LibreOffice。

Atom是一个非常好用的轻量级IDE,它支持html的语法高亮,如果你没有vnc访问权限,你可以使用X11转发。

相关内容