Command-line tool and library to generate Compiler Explorer links.
This tool uses template based approach. To use it, you need to make a template URL first:
- Place @place_the_code_here@ text in source window, it would be replaced with given code
- Open
Share
menu - Click
Full Link
- Copy given link
Then pass it to the tool with path to wanted source file.
Example:
and
#include <iostream>
int main()
{
std::cout << "Hello world!" << '\n';
}
gives
Unfortunately full links contain 1500-2000 characters even in trivial cases. So it might be better to use official RESTful API to request creation of the short link for given code. For python this API can be used via cexpl package.
Copyright (c) 2023 Yaroslav Krylov. Distributed under the MIT license.