mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 09:56:31 +00:00
button and cmdk
This commit is contained in:
189
deps/shui/shui-graph/pages/contents.md
vendored
189
deps/shui/shui-graph/pages/contents.md
vendored
@@ -1,5 +1,5 @@
|
||||
- [[About Shui]]
|
||||
- [[shui/components]]
|
||||
- [[shui/components]] if there was text here
|
||||
- beta
|
||||
- [[shui/components/table]]
|
||||
- up next
|
||||
@@ -15,6 +15,182 @@
|
||||
- [[shui/components/right-sidebar]]
|
||||
- [[shui/components/modal]]
|
||||
- [[shui/components/properties]]
|
||||
- [[shui/components/code]]
|
||||
collapsed:: true
|
||||
- ```css
|
||||
:root {
|
||||
--lx-blue-1: #123456;
|
||||
}
|
||||
```
|
||||
- ```clojurescript
|
||||
(js/document.style.setProperty "--lx-blue-1" ""#abcdef")
|
||||
```
|
||||
- ```python
|
||||
# This is a single-line comment
|
||||
"""
|
||||
This is a
|
||||
multi-line comment (docstring)
|
||||
"""
|
||||
|
||||
# Import statement
|
||||
import math
|
||||
|
||||
# Constant
|
||||
CONSTANT = 3.14159
|
||||
|
||||
# Function definition, decorators and function call
|
||||
@staticmethod
|
||||
def add_numbers(x, y):
|
||||
"""This function adds two numbers"""
|
||||
return x + y
|
||||
|
||||
result = add_numbers(5, 7)
|
||||
|
||||
# Built-in functions
|
||||
print(f"Sum is: {result}")
|
||||
|
||||
# Class definition and object creation
|
||||
class MyClass:
|
||||
# Class variable
|
||||
class_var = "I'm a class variable"
|
||||
|
||||
def __init__(self, instance_var):
|
||||
# Instance variable
|
||||
self.instance_var = instance_var
|
||||
|
||||
def method(self):
|
||||
return self.instance_var
|
||||
|
||||
# Creating object of the class
|
||||
obj = MyClass("I'm an instance variable")
|
||||
print(obj.method())
|
||||
|
||||
# Control flow - if, elif, else
|
||||
num = 10
|
||||
if num > 0:
|
||||
print("Positive number")
|
||||
elif num == 0:
|
||||
print("Zero")
|
||||
else:
|
||||
print("Negative number")
|
||||
|
||||
# For loop and range function
|
||||
for i in range(5):
|
||||
print(i)
|
||||
|
||||
# List comprehension
|
||||
squares = [x**2 for x in range(10)]
|
||||
|
||||
# Generator expression
|
||||
gen = (x**2 for x in range(10))
|
||||
|
||||
# While loop
|
||||
count = 0
|
||||
while count < 5:
|
||||
print(count)
|
||||
count += 1
|
||||
|
||||
# Exception handling
|
||||
try:
|
||||
# Division by zero
|
||||
x = 1 / 0
|
||||
except ZeroDivisionError as e:
|
||||
print("Handling run-time error:", e)
|
||||
|
||||
# Lambda function
|
||||
double = lambda x: x * 2
|
||||
print(double(5))
|
||||
|
||||
# File I/O
|
||||
with open('test.txt', 'r') as file:
|
||||
content = file.read()
|
||||
|
||||
# Assert
|
||||
assert num > 0, "Number is not positive"
|
||||
|
||||
```
|
||||
- ```clojure
|
||||
;; This is a comment
|
||||
|
||||
;; Numbers
|
||||
42
|
||||
2.71828
|
||||
|
||||
;; Strings
|
||||
"Hello, world!"
|
||||
|
||||
;; Characters
|
||||
\a
|
||||
|
||||
;; Booleans
|
||||
true
|
||||
false
|
||||
|
||||
;; Lists
|
||||
'(1 2 3 4 5)
|
||||
|
||||
;; Vectors
|
||||
[1 2 3 4 5]
|
||||
|
||||
;; Maps
|
||||
{:name "John Doe" :age 30 :email "john.doe@example.com"}
|
||||
|
||||
;; Sets
|
||||
#{1 2 3 4 5}
|
||||
|
||||
;; Functions
|
||||
(defn add-numbers [x y]
|
||||
"This function adds two numbers."
|
||||
(+ x y))
|
||||
|
||||
(def result (add-numbers 5 7))
|
||||
(println "Sum is: " result)
|
||||
|
||||
;; Anonymous function
|
||||
(#(+ %1 %2) 5 7)
|
||||
|
||||
;; Conditionals
|
||||
(if (> result 0)
|
||||
(println "Positive number")
|
||||
(println "Zero or negative number"))
|
||||
|
||||
;; Loops
|
||||
(loop [x 0]
|
||||
(when (< x 5)
|
||||
(println x)
|
||||
(recur (+ x 1))))
|
||||
|
||||
;; For
|
||||
(for [x (range 5)] (println x))
|
||||
|
||||
;; Map over a list
|
||||
(map inc '(1 2 3))
|
||||
|
||||
;; Exception handling
|
||||
(try
|
||||
(/ 1 0)
|
||||
(catch ArithmeticException e
|
||||
(println "Caught an exception: " (.getMessage e))))
|
||||
|
||||
;; Macros
|
||||
(defmacro unless [pred a b]
|
||||
`(if (not ~pred) ~a ~b))
|
||||
|
||||
(unless true
|
||||
(println "This will not print")
|
||||
(println "This will print"))
|
||||
|
||||
;; Keywords
|
||||
:foo
|
||||
:bar/baz
|
||||
|
||||
|
||||
```
|
||||
- ```css
|
||||
.example {
|
||||
something: "#abc123"
|
||||
}
|
||||
```
|
||||
- [[shui/colors]]
|
||||
- We want to switch to radix varaibles
|
||||
- We want to make it easy to customize with themes
|
||||
@@ -25,15 +201,8 @@
|
||||
collapsed:: true
|
||||
- var(--lx-color-6)))
|
||||
- light and dark variants
|
||||
- ```css
|
||||
:root {
|
||||
--lx-blue-1: #123456;
|
||||
}
|
||||
```
|
||||
- ```
|
||||
(js/document.style.setProperty "--lx-blue-1" ""#abcdef")
|
||||
```
|
||||
-
|
||||
- [[shui/inline]]
|
||||
-
|
||||
- /
|
||||
-
|
||||
-
|
||||
1
deps/shui/shui-graph/pages/shui___components___toggle.md
vendored
Normal file
1
deps/shui/shui-graph/pages/shui___components___toggle.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
-
|
||||
Reference in New Issue
Block a user