D14738: Add the markdown entry

Nikita Sirgienko noreply at phabricator.kde.org
Thu Aug 16 19:29:45 BST 2018


sirgienko added a comment.


  In D14738#310261 <https://phabricator.kde.org/D14738#310261>, @kqwyf wrote:
  
  > Here comes a problem...
  >
  > The reason I'd like to make rendered markdown entries uneditable is that, if the user edited a rendered markdown entry, then we could never convert the content (in html) back to markdown.
  >  To imitate the behaviors of latex entries better, I thought it's a good idea that the cursor can move on the markdown entries while they can't be edited.
  
  
  In this moment, if you haven't libspectre (or latex), you can't exec latex entry (well, you can, but nothing happens) and another actions allowed. If you haven't libspectre and load worksheet with 
  latex formulas, we can see rendrered images (okay, in this moment, we can't see, but I working on this problem and this will be fix soon on master), but I could edit unrendered latex entries and convert renderered to unrendered entries by double click.
  
  > But in worksheettextitem.cpp, line 433-437, it wrote:
  > 
  >   void WorksheetTextItem::keyPressEvent(QKeyEvent *event)
  >   {
  >       if (!isEditable())
  >           return;
  >       // other code
  >   }
  > 
  > 
  > which means that the cursor can't move on an uneditable entry.
  
  As I know, LaTeX entries always set `Qt::TextEditorInteraction` (see LatexEntry constructor), so isEditable() return true, so I think, this code don't give us problems.
  And as I see, Text entries do the same.
  
  > A compromise solution is to make `MarkdownEntry::wantFocus()` return false when the entry is uneditable. And this will cause the cursor to skip the rendered markdown entries. Is that okay?
  
  LatexEntry and TextEntry don't override `wantFacuse` function from WorksheetEntry, so I don't think, that we need override the function in MarkdownEntry.
  
  > BTW, when loading a rendered markdown entry, the markdown content will be rendered, but the latex formulas will remain in code form (just like the text entries). Is that okay? Or should they be rendered (by saving all the eps files in the archive), too?
  
  Sorry, but I think, I don't  understand your correctly. Rendered LatexEntry saves eps file to archive. As I know Discount generate full html output from markdown, so Markdown Entry haven't any eps files, isn't it?

REPOSITORY
  R55 Cantor

REVISION DETAIL
  https://phabricator.kde.org/D14738

To: kqwyf, pino, #cantor, filipesaraiva
Cc: sirgienko, filipesaraiva, pino, asemke, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20180816/99bb8286/attachment.html>


More information about the kde-edu mailing list