Skip to content

Commit

Permalink
Second commit, with new highlight engine and many others changes.
Browse files Browse the repository at this point in the history
See changelog for detailed info.
  • Loading branch information
sbarex committed Dec 26, 2020
1 parent d372735 commit cca54ca
Show file tree
Hide file tree
Showing 591 changed files with 46,104 additions and 2,651 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1.0.b2
New features:
- Reimplemented in c/c++ previous code developed on the external golang library (emoji, base64 encoding).
- Source code highlight extension now use [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) linked as a library, and with more customizable options.
- GUI updated to use the changed extensions.
- Many others changes.

1.0.b1
First release.
6 changes: 6 additions & 0 deletions GoLibraries/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

libgoutils_arm64.a
libgoutils_arm64.h
libgoutils_x86_64.a
libgoutils_x86_64.h

195 changes: 195 additions & 0 deletions GoLibraries/GoLibraries.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {

/* Begin PBXFileReference section */
837F28F02597817300A5F7DE /* go.mod */ = {isa = PBXFileReference; lastKnownFileType = text; path = go.mod; sourceTree = "<group>"; };
837F28F12597817300A5F7DE /* goutils.go */ = {isa = PBXFileReference; lastKnownFileType = text; path = goutils.go; sourceTree = "<group>"; };
837F28F22597817300A5F7DE /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
837F28F32597817300A5F7DE /* go.sum */ = {isa = PBXFileReference; lastKnownFileType = text; path = go.sum; sourceTree = "<group>"; };
837F28F42597817300A5F7DE /* goutils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = goutils.h; sourceTree = "<group>"; };
837F28F52597817300A5F7DE /* goutils.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = goutils.a; sourceTree = "<group>"; };
837F28F62597817300A5F7DE /* .idea */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .idea; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXGroup section */
837F28EA2597817300A5F7DE = {
isa = PBXGroup;
children = (
837F28F02597817300A5F7DE /* go.mod */,
837F28F12597817300A5F7DE /* goutils.go */,
837F28F22597817300A5F7DE /* Makefile */,
837F28F32597817300A5F7DE /* go.sum */,
837F28F42597817300A5F7DE /* goutils.h */,
837F28F52597817300A5F7DE /* goutils.a */,
837F28F62597817300A5F7DE /* .idea */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXLegacyTarget section */
837F28EF2597817300A5F7DE /* GoLibraries */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "$(ACTION)";
buildConfigurationList = 837F28F72597817300A5F7DE /* Build configuration list for PBXLegacyTarget "GoLibraries" */;
buildPhases = (
);
buildToolPath = /usr/bin/make;
buildWorkingDirectory = /Users/sbaldiss/Develop/OSX/QLMardown/GoLibraries;
dependencies = (
);
name = GoLibraries;
passBuildSettingsInEnvironment = 1;
productName = GoLibraries;
};
/* End PBXLegacyTarget section */

/* Begin PBXProject section */
837F28EB2597817300A5F7DE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1230;
};
buildConfigurationList = 837F28EE2597817300A5F7DE /* Build configuration list for PBXProject "GoLibraries" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 837F28EA2597817300A5F7DE;
projectDirPath = "";
projectRoot = "";
targets = (
837F28EF2597817300A5F7DE /* GoLibraries */,
);
};
/* End PBXProject section */

/* Begin XCBuildConfiguration section */
837F28EC2597817300A5F7DE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
837F28ED2597817300A5F7DE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
};
name = Release;
};
837F28F82597817300A5F7DE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = GoLibraries;
};
name = Debug;
};
837F28F92597817300A5F7DE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = GoLibraries;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
837F28EE2597817300A5F7DE /* Build configuration list for PBXProject "GoLibraries" */ = {
isa = XCConfigurationList;
buildConfigurations = (
837F28EC2597817300A5F7DE /* Debug */,
837F28ED2597817300A5F7DE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
837F28F72597817300A5F7DE /* Build configuration list for PBXLegacyTarget "GoLibraries" */ = {
isa = XCConfigurationList;
buildConfigurations = (
837F28F82597817300A5F7DE /* Debug */,
837F28F92597817300A5F7DE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 837F28EB2597817300A5F7DE /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>GoLibraries.xcscheme_^#shared#^_</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>837F28EF2597817300A5F7DE</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
75 changes: 75 additions & 0 deletions GoLibraries/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.PHONY: static

LDFLAGS=-s
GCFLAGS=

libraries = libgoutils_x86_64.a
libraries_shared = libgoutils_x86_64.dylib

ifneq ($(CONFIGURATION),Debug)
# strip debug symbols
LDFLAGS += -w
endif

ifneq ($(ONLY_ACTIVE_ARCH),NO)
# build arm code
libraries += libgoutils_arm64.a
libraries_shared += libgoutils_arm64.dylib
endif

static: libgoutils.a
shared: libgoutils.dylib

libgoutils.a: ${libraries}
ifneq ($(ONLY_ACTIVE_ARCH),NO)
@echo "Creating universal static library…"
@lipo -create -output libgoutils.a ${libraries}
else
@cp libgoutils_x86_64.a libgoutils.a
endif

libgoutils_x86_64.a: goutils.go
@echo "Compiling x86_64 static library…"
@go build --buildmode=c-archive -gcflags "${GCFLAGS}" -ldflags "${LDFLAGS}" -o ./libgoutils_x86_64.a
@cp libgoutils_x86_64.h goutils.h

libgoutils_arm64.a: goutils.go
@echo "Compiling arm64 static library…"
@GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 CGO_CFLAGS="-target arm64-apple-macos11" CGO_LDFLAGS="-target arm64-apple-macos11" go build --buildmode=c-archive -ldflags "${LDFLAGS}" -o ./libgoutils_arm64.a
@cp libgoutils_arm64.h goutils.h


goutils.dylib: ${libraries_shared}
ifeq ($(CONFIGURATION),Debug)
@cp -R libgoutils_x86_64.dylib libgoutils.dylib
else
@echo "Creating the universal shared library…"
@lipo -create -output libgoutils.dylib ${libraries_shared}
endif

libgoutils_x86_64.dylib: libgoutils.go
@echo "Compiling x86_64 shared library…"
@go build --buildmode=c-shared -ldflags "${LDFLAGS}" -o ./libgoutils_x86_64.dylib
@cp libgoutils_x86_64.h goutils.h

libgoutils_arm64.dylib: libgoutils.go
@echo "Compiling shared arm64 library"
@GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 CGO_CFLAGS="-target arm64-apple-macos11" CGO_LDFLAGS="-target arm64-apple-macos11" go build --buildmode=c-shared -ldflags "${LDFLAGS}" -o ./libgoutils_arm64.dylib
@cp libgoutils_arm64.h goutils.h

# go build --buildmode=c-archive -ldflags "${CGO_LDFLAGS}" -o ./goutils_x86_64.a
# GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 CGO_CFLAGS="-target arm64-apple-macos11" go build --buildmode=c-archive -ldflags "-target arm64-apple-macos11 ${CGO_LDFLAGS}" -o ./goutils_arm64.a
# lipo -create -output goutils.a goutils_x86_64.a goutils_arm64.a
# mv goutils_x86_64.h goutils.h
# rm -f ./goutils_arm64.h
clean:
@rm -f ./libgoutils.a
@rm -f ./libgoutils.dylib
@rm -f ./libgoutils.h

@rm -f ./libgoutils_x86_64.a
@rm -f ./libgoutils_x86_64.dylib
@rm -f ./libgoutils_x86_64.h
@rm -f ./libgoutils_arm64.a
@rm -f ./libgoutils_arm64.dylib
@rm -f ./libgoutils_arm64.h
8 changes: 8 additions & 0 deletions GoLibraries/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/sbarex/qlmarkdown

go 1.14

require (
github.com/go-enry/go-enry/v2 v2.6.0
github.com/vimeo/go-magic v1.0.0 // indirect
)
12 changes: 12 additions & 0 deletions GoLibraries/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-enry/go-enry v1.7.3 h1:MbViVjoR80+AWFY8GmhEdtGY7WYAPxb0A74kLc8X5c0=
github.com/go-enry/go-enry/v2 v2.6.0 h1:nbGWQBpO+D+cJuRxNgSDFnFY9QWz3QM/CeZxU7VAH20=
github.com/go-enry/go-enry/v2 v2.6.0/go.mod h1:GVzIiAytiS5uT/QiuakK7TF1u4xDab87Y8V5EJRpsIQ=
github.com/go-enry/go-oniguruma v1.2.1/go.mod h1:bWDhYP+S6xZQgiRL7wlTScFYBe023B6ilRZbCAD5Hf4=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/vimeo/go-magic v1.0.0 h1:1GGtwzLJwSd7i24Ie7LSNLF0T/w1NiZn5iELjgWcAy4=
github.com/vimeo/go-magic v1.0.0/go.mod h1:xvu4I7AcaioNKakZMURKiJPAlHCTFwIr+qQhOOQQfBk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Loading

0 comments on commit cca54ca

Please sign in to comment.