GithubHelp home page GithubHelp logo

bjones1 / codechat_system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrsuman2002/a_modular_plugin-codechat

3.0 3.0 12.0 7.38 MB

CSS 1.58% JavaScript 16.72% Thrift 1.91% Python 65.53% HTML 1.84% Batchfile 1.02% TypeScript 8.86% C 0.40% Shell 0.48% PowerShell 1.66%

codechat_system's People

Contributors

anw678 avatar bjones1 avatar joekenn1118 avatar mrsuman2002 avatar ploux avatar scarbroughzach avatar stevenclontz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

codechat_system's Issues

Bootstrap Installer for CodeChat and CodeChat server

Austin and I are going to start with the bootstrap installer for Codechat. Taking into consideration the three main OS, Windows, Linux, and MacOS, we want to create a program that downloads the needed files and allocates them to the appropriate folder as if they were being installed manually by the user. The program should require the bare minimum input from the user while also allowing the user to access and use the program files without any confusion by using clear filing implementations. The program will initiate and open the virtual environment used by codechat as to keep the user from having to deal with the clunky command line commands. The command line commands will be entered using a power shell, pre-programming the needed lines to install all needed software. The main language will be python, with possible additions from other languages that are needed as problems arise. Using Pyperclip, we will be able to copy the address of CodeChat from the users command line for ease of transfer. For scrum one, we hope to have atleast 2 of the three main OS's up and running with minimal issue.

Dark-mode support

The client only supports light mode, which means it doesn't work well for the default VS Code theme. Figure out how to provide dark mode.

Notepad++ (part 3)

  1. Describes the feature you will add.
    The feature our group will be adding will be finalizing the Notebook++ support on CodeChat.
  2. Defines which repository/repositories your code will be added to.
    The repository our group will be working out of is the CodeChat_System repository.
  3. Specifies what libraries, languages, and interfaces your code must work with.
    Our group will be working in the thrift library, and we will be coding in C++.
  4. Details a series of steps you will follow to complete this feature.
    Finalizing the notebook++ extension by finishing the code for rendering method.
  5. Defines tests to show the feature works correctly.
    The test that will show the feature is functional is Notebook++ will be showing the ping in the CodeChat client renderer as well as the past features added.
  6. Outlines goals for scrum 1 and scrum 2.
    Scrum 1: Touching up on the thrift features added.
    Scrum 2: Finalize the thrift features/final touches.

More renderers

Support a .json-style list of renderers the server can load. Predefine a bunch of these using pandoc, rust doc gen, javadoc, doxygen, etc.

Sync -Project 3

Features

  • recognize a click on the screen
  • get the coordinates of the click
  • send coordinates to the server
  • then move the other screen to the location

Repositories / Files

  • CodeChat_system
  • Enki
  • /conf.py
  • /CodeChat_Server/CodeChat_Server/render_manager.py
  • /CodeChat_Server/CodeChat_Server/CodeChat_Client/static/CodeChat_client.js
  • /CodeChat_system/CodeChat_Server/CodeChat_Server/CodeChat_Client/templates/CodeChat_client.html

Libraries, Languages, Interfaces

  • Javascript
  • Python
  • HTML

Steps

Our main priority is fixing the html error in the window_onclick() function.
Our Secondary Objective is to scroll the code window (by random amounts) on any click on the html

Tests

  • Get window_onclick() to proceed without errors
  • Get render_manager.py to recognize click and scroll the window

Goals

Implement sync between text and rendered code.

Sync functionality for the CodeChat system in Visual Studio Code.
Feature will allow the user to click parts of the HTML window and be taken to that section of code.

Scrum 1

Confer with Dr. Jones, Zach, and Austin on:

  • status of code
  • how to proceed with fixing the window_onclick() issue.
  • How to make codechat operate off of our changes
  • How to make vscode codechat push to a browser

Scrum 2

  • Get CodeChat_client.js to recognize click on html
  • Get render_manager.py to react to CodeChat_client.js's recognition of click

Sync functionality for the CodeChat system in Visual Studio Code.

Feature:
Sync functionality for the CodeChat system in Visual Studio Code.
Feature will allow the user to click parts of the HTML window and be taken to that section of code.

Libraries:
Tre (Github.com/laurikari/tre) - Specifically pull request #49 - Python 3 Bindings (laurikari/tre#49)

andreikop/enki - https://github.com/andreikop/enki
Specifically https://github.com/andreikop/enki/blob/master/enki/plugins/preview/approx_match.py

CodeChat - https://github.com/bjones1/CodeChat_system

Languages:
Python 3

Sync Functionality Steps:
Compile Tre Library (Outside of Codechat)
Interface Tre with Python (Pull request)
Reference Regex Matching (Java Script) for heuristic approach

Scrum Schedule:
Scrum 1 (3/24):
Objectives:
Understand Tre Library
Compile Tre library
Review Python 3 PR
Find out where in the CodeChat repo this feature goes
Scrum 2 (3/29):
Objectives:
Understand Enki development from Dr.Jones
Match possible ways Python 3 can work in Enki
Begin framework for Sync functionality in Python 3
Print out possible matches from heuristic search
Presentation (3/31):
Demonstrate output of possible matches from heuristic search

CoCalc / Visual Studio Code for the Web

To support a zero-install experience, we need to support CoCalc or GitHub CodeSpaces. I already have hacked CoCalc working.

To do:

url = f"https://cocalc.com/{cocalc_project_id}/server/{HTTP_PORT}/{endpoint}?id={id}"

How do I get the CoCalc project id? The PreTeXt CLI know how to do this.

  • The server needs to run in insecure mode by default -- somehow, we must detect that we're running in CoCalc.

Other than that, the current commits should fix all the remaining issues.

Dark-mode support - Part Two

Dark-Mode Support - Part Two

Feature Description:

We plan on adding additional color schemes. We should be able to fix the error/warning coloring issue of having a dark blue-on-dark gray background when in dark mode.
We will decide on the file naming convention and implement user selection buttons that allow toggling between the newly created color schemes.

Define which repository/repositories your code will be added to.

This code will be added to the CodeChat_system repository.

Specifies what libraries, languages, and interfaces your code must work with.

This code must work with the CodeChat system rendering. This will require the testing of various filetypes and Sphynx themes.

Detail a series of steps you will follow to complete this feature.

• Review documentation received by the previous group
• Ensure proper understanding of documentation and clarify any necessary details via Microsoft Teams
• Find all required code and verify its functionality as it was presented to us.
• Choose suitable color RGB codes for each of the changed items (background, text, error messages, etc.)
• Ensure proper documentation of all changes and steps required to reach the starting point of the project
• Test and edit as needed to verify project success. (Tests are defined below)

Defines tests to show the feature works correctly.

Test .js, .cs .HTML, .py files and ensure proper color scheme functionality for the background, text, and error message display.

Outlines goals for scrum 1 and scrum 2.

Scrum 1:

Meet with the previous group via teams and verify understanding of the problem and relevant code. Work on the project until we get to a sticking point.

Scrum 2:

Verify that the changes made provide a satisfactory solution to the original problem. Ensure the functionality of the new code on another user’s PCs. (Potentially test on Mac OS depending on availability)

Notepad++ (part 2)

  1. Describes the feature you will add.
  • In this sprint, we will continue the development process for adding support for Notepad++ in CodeChat. 
    
  1. Defines which repository/repositories your code will be added to.
  • The code will be added to the CodeChat_System repo.
    
  1. Specifies what libraries, languages, and interfaces your code must work with.
  • Thrift library and  C++
    
  1. Details a series of steps you will follow to complete this feature.
  •  Get thrift libraries to properly compile in source code.
    
  •  Get client to show ping
    
  •  Start creating code for rendering method
    
  1. Defines tests to show the feature works correctly.
  • Create application to run simple framework of thrift and show ping result
    
  • Implement the thrift ping framework in code chat on a render
    
  1. Outlines goals for scrum 1 and scrum 2.
  •  Scrum 1 - discuss all possible options for thrift features in vscode and create timeline/draft for PRs
    
  •  Scrum 2 - outline features in PRs and future work for next group
    
  •  First PR will show application to run simple ping using thrift framework
    

Sync- Part 2

Austin and Zach will be doing the sync functionality for CodeChat in the CodeChat_System/sync repository. We will be using python with the tre, cgi, codecs, and og libraries. Our goal for this stretch will be to pick up where the previous group left off with the approximate search function and the test criteria. Our goal for scrum 1 is to have the sync system completely functional with a proper test system by scrum 2.

Multi-project support

Currently, the server equates a plugin/client with a single project, which changes with each render. Instead, have the concept of a project which keeps state if different files in the same project are opened. Keep a LRU cache of the last n projects.

Notepad ++ Extension

Feature

Support the Notepad++ text editor and provide similar integration as exists for Visual Studio Code.

Repositories

  1. CodeChat_system, with changes likely confined to the "extensions" subfolder

  2. Generate a Notepad++ plugin .dll file. optimally, have this file included in the npp-plugins project so installation in Notepad++ can be performed via the menu bar

Libraries / Languages / Interfaces

Notepad++ is written in C++. While there is support for creating Notepad++ plugins in several languages, such as Ada, C#, D, and Delphi, C++ is most common and what we will be using.

Steps

Notepad++ Integration

  1. Build "Hello World" plugin
  2. Explore more advanced plugins that include split-screen functionality, such as MarkdownViewer
  3. Create a simple split-screen plugin of our own
  4. Create fully-functioning CodeChat plugin.

CodeChat Integration

  1. Connect NotePad++ plugin to thrift
  2. Make html output update every time a new file is opened or the current file is saved.
  3. Make html output display in either browser or in split screen
  4. Create fully-functioning CodeChat plugin

Test

  1. Have the NotePad++ Plugin create a "Hello World" .html file from CodeChat

  2. Have the NotePad++ Plugin create a split screen on start-up

  3. Have Notepad++ build html output files for multiple file types

    • .py
    • .c and .cpp
    • .md
    • .thrift
    • etc.

Goals

Scrum 1

Understand what files, libraries, and tools we will need to complete the project

Scrum 2

Create a basic plugin for NotePad++ that can render a file into .html

Support more editors

Currently, we only support VS Code. Write editor plugins for more editors, especially since the VS Code plugin in close to complete.

Add button to manually rebuild

I often get a build that's slightly stale by a few keystrokes. One way to trigger a rebuild is to add in some idempotent whitespace, but a button (maybe also a keyboard shortcut) to trigger the relevant rebuild would be great.

Testing

Write unit tests for the server, the editor plugin, and the client.

Packaging

The server isn't packaged. Need this for Windows (probably PyInstaller + NSIS), Linux (install from source; ugh -- which flavors to support), MacOS (Brew, I know little about this).

At a minimum, provide better installation instructions. It's probably good enough to provide a two-line Linux script (install python3-pip, then pip install CodeChat). For Mac, a two-line script (brew install python, pip install CodeChat) should be good enough. Need to test of the Microsoft store Python will work. If so, perhaps that's an easy approach.

Error: 404 Not Found - No Module named CodeChat

I have followed the steps in the installation instructions, but when I run index.rst from the Codechat_system-Master I get this error.
Running on Windows 10 with Python 3.9.10

image

The error from the terminal:

Build messages
Loading project file c:\Users\Sam\Documents\CodeChat_system-master\CodeChat_Server\CodeChat_Server\templates\sphinx\codechat_config.yaml.
c:\Users\Sam\Documents\CodeChat_system-master\CodeChat_Server\CodeChat_Server\templates\sphinx > sphinx-build . _build
Running Sphinx v4.4.0

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
File "C:\Users\Sam\AppData\Local\Programs\Python\Python39\lib\site-packages\sphinx\config.py", line 340, in eval_config_file
exec(code, namespace)
File "c:\Users\Sam\Documents\CodeChat_system-master\CodeChat_Server\CodeChat_Server\templates\sphinx\conf.py", line 37, in
import CodeChat.CodeToRest
ModuleNotFoundError: No module named 'CodeChat'

c:\Users\Sam\Documents\CodeChat_system-master\CodeChat_Server\CodeChat_Server\templates\sphinx\index.rst:: ERROR: CodeChat renderer - unable to find the HTML output file c:\Users\Sam\Documents\CodeChat_system-master\CodeChat_Server\CodeChat_Server\templates\sphinx_build\index.rst.

Terminal showing where codechat_server is installed
image

Settings from VsCode
image

Dark Mode 3

Features to be added:
Improve on current dark mode implementation and add functionality of a GUI to turn dark mode on and off
Repository:
CodeChat_System
Source:
CodeChat_System source code
Steps:

  1. Confirm current dark mode state functionality
  2. polish
  3. implement GUI
  4. test
  5. test again
  6. profit
    Test Procedure
    Test procedure is simply to get to a state where we can easily turn dark mode on and off and looks clean

Scrum 1
Have dark mode effective and have a plan for GUI

Scrum 2
Fully implemented GUI that activates and deactivates a clean and well run dark mode.

VS Code plugin should launch the server

The VS Code server should launch the server when it starts up or on a disconnect/reconnect. This needs #3 implemented first.

We'll also need to add a config value to specify the path to the server.

CodeChat not functioning with Pretext project. "source newer than html" error

For context, I encountered this issue with a Windows VS Code local setup. Newly installed CodeChat_server and CodeChat extension.

The issue is that CodeChat will display html build of pretext project after building with pretext-tools in VS Code, but it does not update as I edit the source file. Also, if I save the source file, CodeChat throws the following error below the html view window:

C:\FOO\codechat\Scripts\python.exe: No module named pretext c:\FOO\Documents\books\BC_Live\source\sec_constructing-demand.ptx:: ERROR: CodeChat renderer - source file newer than the HTML file c:\FOO\Documents\books\BC_Live\output\web\sec_constructing-demand.html.

It may be a problem with my specific setup on Windows but I followed the instructions on the readthedocs.io page . I am least certain about my path to the server setup in the extension, but it would seem CodeChat wouldn't be able to display if it couldn't find the server.

How to present user docs and developer docs

For many applications -- certainly, CodeChat and the CodeChat System -- there will be both user docs and developer docs. What's the best way to structure these? We need some documentation principles added to CodeChat/docs/style_guide.cpp.

Thoughts:

  • Have two separate doctree hierarchies. The homepage will always be the user docs.
  • Provide links between user and developer docs at similar levels of the hierarchy.
  • Define a naming convention: user-file.rst and dev-file.rst?

After defining this, update the actual CodeChat / CodeChat System docs to use this approach.

Report failure to generate sageplot when refreshing

A PreTeXt author just showed me an issue with CodeChat: she made a mistake in her <sageplot> that made it unable to generate (she wrote 2x rather than 2*x). But CodeChat didn't report any error, so she didn't understand why her image wouldn't "update" when she changed the code.

Terminal emulation

Use something like xterm.js to provide terminal support. Question: how to embed hyperlinks in error messages? It looks like xterm.js doesn't support this, but perhaps an addon does? If so, how to embed a JS onclicked action? Perhaps using a find-and-replace? Or perhaps create URLs that hit a server endpoint to do the link connect.

Sync

Implement sync between text and rendered code.

Hyperlink - bug

  1. Describes the feature you will add.

    • Group 1) For this project, we will modify the existing CodeChat code so that it properly hyperlinks the file and the line. During this process, we will document any relevant information such as an explanation on ‘Regular Expressions’ in addition to any changes that we make.
    • Group 2) The group before us updated the CodeChat code so that it properly hyperlinks the file and the line. We will be double checking that this works.
  2. Defines which repository/repositories your code will be added to.

    • Group 1) Our documentation and code will be merged into the branch at CodeChat_system.
    • Group 2) Will be creating a read me file-hyperlink debugging project to keep track of our research and update this issue with the link to it for the next group.
  3. Specifies what libraries, languages, and interfaces your code must work with.

    • Group 1) Our code is primarily going to be written in JavaScript. I think that any edits should continue to work on any operating system that is already running CodeChat.
    • Group 2) Neither of us are familiar with JavaScript. We would have to go through a crash course to learn this code. IF we are able to use C, Python, or HTML would be easier for us.
  4. Details a series of steps you will follow to complete this feature.

    • Group 1) The first step in this coding project is understanding how hyperlinks are currently handled in CodeChat.
    • Group 2) Our first step is trying to figure out what the previous group did, where they left off, and what is next.
  5. Defines tests to show the feature works correctly.

    • Group 1) The exact formatting is to be determined. We will test the error hyperlinking with multiple different types of errors. Another project requirement is that the hyperlink should bring you to the line as well as highlight the line that contains the error.
    • Group 2) We will be testing what the previous group did by generating common errors.
  6. Outlines goals for scrum 1 and scrum 2.

  • Scrum 1 goals:
    • Know where the project is at work wise
    • Created a readme-hyperlink_debugging file

  • Scrum 2 goals:
    • Have a list of items for both coders to work on.
    • Have list of issues in the readme file with check marks on what was done so far.

Offer to install codechat server if it is missing

Specifically for the VS Code extension, it would be helpful if upon discovering that codechat_server is not installed, the extension offered to run pip install codechat_server. This is what I do for pretext-tools and pretext. I could implement the step there, but it might be of wider interest.

If you agree this is a desired feature, I could contribute it here.

CodeChat client fails on network disconnect

When the network is disconnected, then later reconnected, the CodeChat client don't sense this or try to reconnect, so that it doesn't receive updates from the server.

Plan: it looks like I need to define a ping/pong sent from the client to the server, since the client doesn't know if it's disconnected.

Hyperlink Part 3

Describes the feature you will add.

Group 1) For this project, we will modify the existing CodeChat code so that it properly hyperlinks the file and the line. During this process, we will document any relevant information such as an explanation on ‘Regular Expressions’ in addition to any changes that we make.
Group 2) The group before us updated the CodeChat code so that it properly hyperlinks the file and the line. We will be double checking that this works.
Group3) Testing the Hyperlink system in Linux and Mac and create common error page

Defines which repository/repositories your code will be added to.

Group 1) Our documentation and code will be merged into the branch at CodeChat_system.
Group 2) Will be creating a read me file-hyperlink debugging project to keep track of our research and update this issue with the link to it for the next group.
Group 3) Will be doing the same as the previous groups

Specifies what libraries, languages, and interfaces your code must work with.

Group 1) Our code is primarily going to be written in JavaScript. I think that any edits should continue to work on any operating system that is already running CodeChat.
Group 2) Neither of us are familiar with JavaScript. We would have to go through a crash course to learn this code. IF we are able to use C, Python, or HTML would be easier for us.
Group 3) The same as above and others that might come up while debugging the linux and mac errors.

Details a series of steps you will follow to complete this feature.

Group 1) The first step in this coding project is understanding how hyperlinks are currently handled in CodeChat.
Group 2) Our first step is trying to figure out what the previous group did, where they left off, and what is next.
Group 3) Run Codechat with the hyperlink errors on Linux and Mac and see what an issue might be.

Defines tests to show the feature works correctly.

Group 1) The exact formatting is to be determined. We will test the error hyperlinking with multiple different types of errors. Another project requirement is that the hyperlink should bring you to the line as well as highlight the line that contains the error.
Group 2) We will be testing what the previous group did by generating common errors.
Group 3) Same as above

Outlines goals for scrum 1 and scrum 2.

Scrum 1 goals:
• Know where the project is at work wise
• Set up tests on our devices

Scrum 2 goals:
• Begin debugging the issues with the different OS

Boot Strap Installer #3

  1. Describes the feature you will add.
    a) Right now the first step to the installer is get python. I have noticed that python from the window store doesn’t always work. So going to work on getting the hyperlink to the web added the installer guide. Have to run the Powershell Script to know what is exactly going on with the windows version.
    i) Open issues to look at
    (1) Codechat.sh is close to completion
    (2) Updating the easyinstallnotes.rst with what the previous group did.
    (3) Install.rst-> this seems like a copy and paste of the easyinstallnotes.rst -> might delete.
    (4) Windows_installer.ps1 ->The windows powershell script, pretty close to one line but not quite, still needs a bit of work. Dr. Jones wants this to be one line and some bugs need to be ironed out.
    The first being in Windows 11, The function at the end that collects the location of codechat_server.exe and copys it to your clipboard does not seem to work. also, it seems that the Set-Execution Policy for windows 11 needs to be unrestricted instead of remote signed
  2. Defines which repository/repositories your code will be added to.
    a) This project can be found in the Codechat_system -> installer branch.
  3. Specifies what libraries, languages, and interfaces your code must work with.
    a) This project uses python, pyperclip, and powershell.
    i) No idea what power shell or pyperclip is. We will have to learn that quickly.
  4. Details a series of steps you will follow to complete this feature.
    a) Must read through the two python files to clean up and see if they are the same
    b) Must run the install to see why it’s not working on windows 11
    c) Run the install on windows 10 and make sure there are no issues
    i) If so, get them corrected.
  5. Defines tests to show the feature works correctly.
    a) Making a PDF of the installer steps
    b) Uninstalling our visual studio and codechat stuff
    c) Reinstalling following the steps.
  6. Outlines goals for scrum 1 and scrum 2.
    a) Scrum 1:
    i) Both coders have used the steps given to install on computers.
    ii) Documented any problems that need to be fixed or cleaned up.
    b) Scrum 2:
    i) Have the installer working on Windows 10 and 11.
    ii) Have the installer steps updated and either a html file or a file that can open up in explore to follow the steps to install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.