Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: extra markup for importing externally developed tasks #14

Open
dz0 opened this issue Oct 19, 2017 · 3 comments
Open

Proposal: extra markup for importing externally developed tasks #14

dz0 opened this issue Oct 19, 2017 · 3 comments

Comments

@dz0
Copy link
Contributor

dz0 commented Oct 19, 2017

WS backend is not the most convenient for developing tasks...
I want to be able to define areas in fully working program, so I propose to use /**: and :**/ to hide ws stuff in the program, example:

#include <iostream>
using namespace std;

int main() {
//*:  \[  
   cout << "Hello, world!" << endl;
   
/**:   \show:
   cout << Hello, <<
   cout << world!
]\
:**/
   return 0;
}

and when pasting them to WS source-code (I use extra textarea) , these metacomments would be stripped:

    var code = $('textarea#smart-paste').val();
    // replace (delete) metacomments:  //*: ,    /**:     and       :**/
    code = code.replace( /\/\/\*\:/g, '');   //   //*:  
    code = code.replace( /\/\*\*\:/g, '');   //   /**:  
    code = code.replace( /\:\*\*\//g, '');  //   :**/
    // put into CM
    codemirrors[""+9].setValue(code);   // for CPP  9-th are is used
dz0 added a commit to Adamawa/websheets that referenced this issue Oct 19, 2017
@daveagp
Copy link
Owner

daveagp commented Oct 21, 2017

I'm not actively developing but this sounds like a useful thing to push into the repo.

I don't understand the magic number 9 here or the comment, can you reiterate? And the ""+9?

@dz0
Copy link
Contributor Author

dz0 commented Oct 26, 2017 via email

@daveagp
Copy link
Owner

daveagp commented Oct 28, 2017

I merged this in and cleaned up the magical bits with 2 follow up commits:
https://github.com/daveagp/websheets/commits/master
Can you see if it works for you?

The UI still could be improved. What if I change it to a button like "Delete /** areas **/" at the top and have it directly filter them out of the relevant editor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants